Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
115948 | 欧阳俊懿 | 最简真分数 | C++ | Compile Error | 0 MS | 0 KB | 770 | 2025-04-05 17:41:31 |
#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; bool z(int &a,int &b){ int x=min(a,b); while(x>0){ if(a%x==0&&b%x==0){ if(x==1) return true; else return false; } x--; } } int main(){ int n,i,j; long long sum=0; cin>>n; for(i=0;i<n;i++) { cin>>a[i]; } for(i=0;i<=n;i++) { for(j=i+1;j<=n;j++){ if(z(a[i],a[j])) sum++; } } return 0; }
Main.cc: In function 'int main()': Main.cc:25:14: error: 'a' was not declared in this scope cin>>a[i]; ^ Main.cc:31:22: error: 'a' was not declared in this scope if(z(a[i],a[j])) ^ Main.cc: In function 'bool z(int&, int&)': Main.cc:18:1: warning: control reaches end of non-void function [-Wreturn-type] } ^