Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139775 黄芃硕 最简真分数 C++ Compile Error 0 MS 0 KB 386 2025-12-08 19:14:05

Tests(0/0):


Code:

#include<iostream> #include<cstring> using namespace std; int t(int x,int y) { int r=x%y; while(r!=0) { x=y; y=r; r=x%y; } return y; } int main() { int n,a[606]; cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; } for(int i=1;i<=n;i++) { for(int j=i+1;j<=n;j++) { if(t(a[1],a[j])==1) { s++; } } } cout<<s; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:29:5: error: 's' was not declared in this scope
     s++;
     ^
Main.cc:33:8: error: 's' was not declared in this scope
  cout<