#include <iostream> using namespace std; int main(int argc, char** argv) { int c; cout<<"请输入你要判断的数:"<<endl; system("pause"); cin>>c; if(c%2==0||c%3==0){ cout<<"这个数是合数"; }else if(c%1==0&&c%c==0){ cout<<"这个数是质数"; }else if(c==1||c==2||c==3){ cout<<"这个数是质数"; } return 0; }
标签:std,判断,cout,int,质数,c%,合数 From: https://www.cnblogs.com/w6826301/p/17465358.html