Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
126491 | 蔡书涵 | 素数对 | C++ | Compile Error | 0 MS | 0 KB | 431 | 2025-07-19 16:12:50 |
#include<bits/stdc++.h> using namespace std; bool zhi(int n){ for(int i=2;i<n;i++){ if(n%i==0){ return false; } } return true; } int main(){ int n,s++; cin>>n; for(int i=2;i<n;i++){ if(zhi(i)==true&&zhi(i+2)==true){ cout<<i<<" "<<i+2<<endl; s++; } } if(s==0){ cout<<"No"; } return 0; }
Main.cc: In function 'int main()': Main.cc:13:12: error: expected initializer before '++' token int n,s++; ^ Main.cc:18:13: error: 's' was not declared in this scope s++; ^ Main.cc:21:8: error: 's' was not declared in this scope if(s==0){ ^