Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118992 胥博雯 判断质数(使用while循环) C++ Wrong Answer 1 MS 272 KB 480 2025-05-11 16:36:29

Tests(0/10):


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,i=2; bool f=0; cin>>n; while(i<n){ if(n%i==0){ f=1; break; } i++; } if(f==0)cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }


Run Info:

------Input------
157
------Answer-----
Yes
------Your output-----
YES