Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160932 钱炜懿 判断质数(使用while循环) C++ Compile Error 0 MS 0 KB 425 2026-09-26 16:49:55

Tests(0/0):


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 i=2,n=0; bool f=true; cin>>n; while(i<=n/2){ if(n%i==0){ f=false break; } i++; } cout<<i; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:14:5: error: expected ';' before 'break'
     break;
     ^