Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
101781 房知谦 素数判断 C++ Accepted 1 MS 272 KB 493 2024-12-18 20:22:50

Tests(1/1):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n; cin>>n; int p=0; for(int i=2;i<n;i++){ if(n%i==0){ p++; } } if(p>=1){ cout<<"not prime"; } else{ cout<<"prime"; } return 0; }