Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158332 杨正蠔 判断质数(使用while循环) C++ Time Limit Exceeded 1000 MS 272 KB 471 2026-08-21 09:41:34

Tests(0/10):


Code:

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