Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
130147 李鸿文添 判断质数(使用while循环) C++ Accepted 2 MS 280 KB 436 2025-09-07 17:29:44

Tests(10/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,a; cin>>n; a=2; while(a<n){ if(n%a==0){ cout<<"No";return 0; } a++; } cout<<"Yes"; return 0; }