Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
91421 | 孙嘉言 | 最简真分数 | C++ | Compile Error | 0 MS | 0 KB | 497 | 2024-09-21 18:04:36 |
#include <iostream> #include <cmath> using namespace std; bool a(int x,int y){ int sb; while(x%y!=0) { sb=x%y; x=y; y=sb; }if(sb==1) return true; else return false; } int main(){ int n,o[10001],s=0; cin>>n; for(int i=1;i<=n;i++){ cin>>o[i]; }sort(o,o+n+1); for(int i=1;i<=n-1;i++){ for(int j=i+1;j<=n;j++){ if(a(o[i],o[j])) s++; } }cout<<s; return 0; }
Main.cc: In function 'int main()': Main.cc:21:17: error: 'sort' was not declared in this scope }sort(o,o+n+1); ^