Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
130362 谭思宸 素数对 C++ Compile Error 0 MS 0 KB 440 2025-09-13 11:15:30

Tests(0/0):


Code:

#include<iostream> #include<cmath> using namespace std; bool ZS(int x){ for(int i=2;i<=sqrt(x);i++){ if(x%i==0){ return false; } } return true; } int main(){ int n; int fiag=0; cin>>n; for(int i=2;i+2<=n;i++){ if(ZS(i)&&ZS(I+2)){ cout<<i<<" "<<i+2<<endl;; flag++; } } if(flag==0)cout<<"No"<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:19:22: error: 'I' was not declared in this scope
         if(ZS(i)&&ZS(I+2)){
                      ^
Main.cc:21:9: error: 'flag' was not declared in this scope
         flag++;   
         ^
Main.cc:24:8: error: 'flag' was not declared in this scope
     if(flag==0)cout<<"No"<