Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
115485 罗子童 最简真分数 C++ Compile Error 0 MS 0 KB 655 2025-03-30 19:08:37

Tests(0/0):


Code:

#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){ for(int i=2;i<=n;i++){ if(a%i==0&&b%i==0) return 0; } return 1; } int main(){ int n,s=0,y[600]; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0;i<n-1;i++){ for(int j=i+1;j<n;j++){ if(z(a[i],a[j])){ s++; } } } cout<<s; return 0; }


Run Info:

Main.cc:23:17: error: stray '\357' in program
                 s++;
                 ^
Main.cc:23:17: error: stray '\274' in program
Main.cc:23:17: error: stray '\233' in program
Main.cc: In function 'bool z(int, int)':
Main.cc:7:20: error: 'n' was not declared in this scope
     for(int i=2;i<=n;i++){
                    ^
Main.cc: In function 'int main()':
Main.cc:19:14: error: 'a' was not declared in this scope
         cin>>a[i];
              ^
Main.cc:22:18: error: 'a' was not declared in this scope
             if(z(a[i],a[j])){
                  ^
Main.cc:24:13: error: expected ';' before '}' token
             }
             ^
Main.cc:16:15: warning: unused variable 'y' [-Wunused-variable]
     int n,s=0,y[600];
               ^