Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5285 黄宜洋 18统计成绩 C++ Compile Error 0 MS 0 KB 3438 2024-11-09 14:41:09

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; int n,a[105],s=0,max_n=-100,min_n=105; double p=0; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]<min_n) min_n=a[i]; if(a[i]>max_n) max_n=a[i]; s=s+a[i]; } p=s*1.0/n; printf("%d %.2lf %d %d\n",s,p,max_n,min_n); return 0; }#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; int n,a[105],s=0,max_n=-100,min_n=105; double p=0; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]<min_n) min_n=a[i]; if(a[i]>max_n) max_n=a[i]; s=s+a[i]; } p=s*1.0/n; printf("%d %.2lf %d %d\n",s,p,max_n,min_n); return 0; }#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; int n,a[105],s=0,max_n=-100,min_n=105; double p=0; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]<min_n) min_n=a[i]; if(a[i]>max_n) max_n=a[i]; s=s+a[i]; } p=s*1.0/n; printf("%d %.2lf %d %d\n",s,p,max_n,min_n); return 0; }#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; int n,a[105],s=0,max_n=-100,min_n=105; double p=0; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]<min_n) min_n=a[i]; if(a[i]>max_n) max_n=a[i]; s=s+a[i]; } p=s*1.0/n; printf("%d %.2lf %d %d\n",s,p,max_n,min_n); return 0; }#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; int n,a[105],s=0,max_n=-100,min_n=105; double p=0; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]<min_n) min_n=a[i]; if(a[i]>max_n) max_n=a[i]; s=s+a[i]; } p=s*1.0/n; printf("%d %.2lf %d %d\n",s,p,max_n,min_n); return 0; }#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; int n,a[105],s=0,max_n=-100,min_n=105; double p=0; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]<min_n) min_n=a[i]; if(a[i]>max_n) max_n=a[i]; s=s+a[i]; } p=s*1.0/n; printf("%d %.2lf %d %d\n",s,p,max_n,min_n); return 0; }


Run Info:

Main.cc:24:2: error: stray '#' in program
 }#include  // cin\cout\endl
  ^
Main.cc:47:2: error: stray '#' in program
 }#include  // cin\cout\endl
  ^
Main.cc:70:2: error: stray '#' in program
 }#include  // cin\cout\endl
  ^
Main.cc:93:2: error: stray '#' in program
 }#include  // cin\cout\endl
  ^
Main.cc:116:2: error: stray '#' in program
 }#include  // cin\cout\endl
  ^
Main.cc:24:3: error: 'include' does not name a type
 }#include  // cin\cout\endl
   ^
Main.cc:30:5: error: redefinition of 'int n'
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:7:5: error: 'int n' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:30:12: error: redefinition of 'int a [105]'
 int n,a[105],s=0,max_n=-100,min_n=105;
            ^
Main.cc:7:7: error: 'int a [105]' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
       ^
Main.cc:30:14: error: redefinition of 'int s'
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:7:14: error: 'int s' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:30:18: error: redefinition of 'int max_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:7:18: error: 'int max_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:30:29: error: redefinition of 'int min_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:7:29: error: 'int min_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:31:8: error: redefinition of 'double p'
 double p=0;
        ^
Main.cc:8:8: error: 'double p' previously defined here
 double p=0;
        ^
Main.cc: In function 'int main()':
Main.cc:33:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:10:5: error: 'int main()' previously defined here
 int main(){
     ^
Main.cc: At global scope:
Main.cc:47:3: error: 'include' does not name a type
 }#include  // cin\cout\endl
   ^
Main.cc:53:5: error: redefinition of 'int n'
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:7:5: error: 'int n' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:53:12: error: redefinition of 'int a [105]'
 int n,a[105],s=0,max_n=-100,min_n=105;
            ^
Main.cc:7:7: error: 'int a [105]' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
       ^
Main.cc:53:14: error: redefinition of 'int s'
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:7:14: error: 'int s' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:53:18: error: redefinition of 'int max_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:7:18: error: 'int max_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:53:29: error: redefinition of 'int min_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:7:29: error: 'int min_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:54:8: error: redefinition of 'double p'
 double p=0;
        ^
Main.cc:8:8: error: 'double p' previously defined here
 double p=0;
        ^
Main.cc: In function 'int main()':
Main.cc:56:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:10:5: error: 'int main()' previously defined here
 int main(){
     ^
Main.cc: At global scope:
Main.cc:70:3: error: 'include' does not name a type
 }#include  // cin\cout\endl
   ^
Main.cc:76:5: error: redefinition of 'int n'
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:7:5: error: 'int n' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:76:12: error: redefinition of 'int a [105]'
 int n,a[105],s=0,max_n=-100,min_n=105;
            ^
Main.cc:7:7: error: 'int a [105]' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
       ^
Main.cc:76:14: error: redefinition of 'int s'
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:7:14: error: 'int s' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:76:18: error: redefinition of 'int max_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:7:18: error: 'int max_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:76:29: error: redefinition of 'int min_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:7:29: error: 'int min_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:77:8: error: redefinition of 'double p'
 double p=0;
        ^
Main.cc:8:8: error: 'double p' previously defined here
 double p=0;
        ^
Main.cc: In function 'int main()':
Main.cc:79:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:10:5: error: 'int main()' previously defined here
 int main(){
     ^
Main.cc: At global scope:
Main.cc:93:3: error: 'include' does not name a type
 }#include  // cin\cout\endl
   ^
Main.cc:99:5: error: redefinition of 'int n'
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:7:5: error: 'int n' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:99:12: error: redefinition of 'int a [105]'
 int n,a[105],s=0,max_n=-100,min_n=105;
            ^
Main.cc:7:7: error: 'int a [105]' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
       ^
Main.cc:99:14: error: redefinition of 'int s'
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:7:14: error: 'int s' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:99:18: error: redefinition of 'int max_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:7:18: error: 'int max_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:99:29: error: redefinition of 'int min_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:7:29: error: 'int min_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:100:8: error: redefinition of 'double p'
 double p=0;
        ^
Main.cc:8:8: error: 'double p' previously defined here
 double p=0;
        ^
Main.cc: In function 'int main()':
Main.cc:102:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:10:5: error: 'int main()' previously defined here
 int main(){
     ^
Main.cc: At global scope:
Main.cc:116:3: error: 'include' does not name a type
 }#include  // cin\cout\endl
   ^
Main.cc:122:5: error: redefinition of 'int n'
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:7:5: error: 'int n' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
     ^
Main.cc:122:12: error: redefinition of 'int a [105]'
 int n,a[105],s=0,max_n=-100,min_n=105;
            ^
Main.cc:7:7: error: 'int a [105]' previously declared here
 int n,a[105],s=0,max_n=-100,min_n=105;
       ^
Main.cc:122:14: error: redefinition of 'int s'
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:7:14: error: 'int s' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
              ^
Main.cc:122:18: error: redefinition of 'int max_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:7:18: error: 'int max_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                  ^
Main.cc:122:29: error: redefinition of 'int min_n'
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:7:29: error: 'int min_n' previously defined here
 int n,a[105],s=0,max_n=-100,min_n=105;
                             ^
Main.cc:123:8: error: redefinition of 'double p'
 double p=0;
        ^
Main.cc:8:8: error: 'double p' previously defined here
 double p=0;
        ^
Main.cc: In function 'int main()':
Main.cc:125:5: error: redefinition of 'int main()'
 int main(){
     ^
Main.cc:10:5: error: 'int main()' previously defined here
 int main(){
     ^