submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s303264446
p00027
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) const int month[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30}; int main() { int m, d, cntdays = 0; while (cin >> m >> d, m + d){ cntdays = month[m - 1] + d; switch (cntdats % 7){ case 1: cout << Monday; break; case 2: cout << Tuesday; break; case 3: cout << Wednesday; break; case 4: cout << Thursday; break; case 5: cout << Friday; break; case 6: cout << Saturday; break; case 0: cout << Sunday; break; cout << endl; } } }
a.cc: In function 'int main()': a.cc:13:13: error: 'cntdats' was not declared in this scope; did you mean 'cntdays'? 13 | switch (cntdats % 7){ | ^~~~~~~ | cntdays a.cc:15:17: error: 'Monday' was not declared in this scope 15 | cout << Monday; | ^~~~~~ a.cc:18:17: error: 'Tuesday' was not declared in this scope 18 | cout << Tuesday; | ^~~~~~~ a.cc:21:17: error: 'Wednesday' was not declared in this scope 21 | cout << Wednesday; | ^~~~~~~~~ a.cc:24:17: error: 'Thursday' was not declared in this scope 24 | cout << Thursday; | ^~~~~~~~ a.cc:27:17: error: 'Friday' was not declared in this scope 27 | cout << Friday; | ^~~~~~ a.cc:30:17: error: 'Saturday' was not declared in this scope 30 | cout << Saturday; | ^~~~~~~~ a.cc:33:17: error: 'Sunday' was not declared in this scope 33 | cout << Sunday; | ^~~~~~
s884366367
p00027
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) const int month[] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30}; int main() { int m, d, cntdays = 0; while (cin >> m >> d, m + d){ cntdays = month[m - 1] + d; switch (cntdats % 7){ case 1: cout << "Monday"; break; case 2: cout << "Tuesday"; break; case 3: cout << "Wednesday"; break; case 4: cout << "Thursday"; break; case 5: cout << "Friday"; break; case 6: cout << "Saturday"; break; case 0: cout << "Sunday"; break; cout << endl; } } }
a.cc: In function 'int main()': a.cc:13:13: error: 'cntdats' was not declared in this scope; did you mean 'cntdays'? 13 | switch (cntdats % 7){ | ^~~~~~~ | cntdays
s906830781
p00027
C++
#include <iostream> #include <string> using namespace std; int min(){ string y[7] = {"Wednesday", "Thrsday", "Frinday", "Saturday", "Sunday", "Monday", "Tuesday"}; int mon[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; while(1){ int m, d; cin >> m >> d; if(m == 0) break; while(m != 0){ d = d + mon[m-1]; } cout << y[d%7] <<endl; } }
a.cc: In function 'int min()': a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type] 20 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s949920940
p00027
C++
#include <iostream> #include <string> using namespace std; int min(){ string y[7] = {"Wednesday", "Thrsday", "Frinday", "Saturday", "Sunday", "Monday", "Tuesday"}; int mon[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; while(1){ int m, d; cin >> m >> d; if(m == 0) break; while(m != 0){ d = d + mon[m-1]; } cout << y[d%7] << endl; } }
a.cc: In function 'int min()': a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type] 20 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s873282887
p00027
C++
#include <iostream> #include <string> using namespace std; int min(){ string y[7] = {"Wednesday", "Thrsday", "Frinday", "Saturday", "Sunday", "Monday", "Tuesday"}; int mon[13] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; while(1){ int m, d; cin >> m >> d; if(m == 0) break; while(m != 0){ d = d + mon[m-1]; m--; } cout << y[d%7] << endl; } }
a.cc: In function 'int min()': a.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type] 21 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s357910324
p00027
C++
import java.util.*; public class Main { static String[] Day=new String[10]; public static void setDay(){ Day[0]="Wednesday"; Day[1]="Thursday"; Day[2]="Friday"; Day[3]="Saturday"; Day[4]="Sunday"; Day[5]="Monday"; Day[6]="Tuesday"; } static int[] Month=new int[20]; public static void setMonth(){ Month[1]=31; Month[2]=29; Month[3]=31; Month[4]=30; Month[5]=31; Month[6]=30; Month[7]=31; Month[8]=31; Month[9]=10; Month[10]=31; Month[11]=30; Month[12]=31; } public static void main(String args[]){ setDay(); setMonth(); Scanner in=new Scanner(System.in); int date,month,days; while(in.hasNextInt()){ month=in.nextInt(); date=in.nextInt(); if(month==0&&date==0) break; days=0; for(int i=1;i<month;i++) days+=Month[i]; days+=date; System.out.println(Day[days%7]); } in.close(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s967635616
p00027
C++
#include<iostream> using namespace std; int main(){ int mon,day,week; while(1){ cin>>mon>>day; if(mon==0)break; switch(mon){ case 1: mon=0; break; case 2: mon=31; break; case 3: mon=60; break; case 4: mon=91; break; case 5: mon=121; break; case 6: mon=152; break; case 7: mon=182; break; case 8: mon=213; break; case 9: mon=244; break; case 10: mon=274; break; case 11: mon=305; break; case 12: mon=335; break; } week=(mon+day)%7; switch(week){ case 1: cout<<"??¨?????\ Thursday"<<endl; break; case 2: cout<<"????????\ Friday"<<endl; break; case 3: cout<<"????????\ Saturday"<<endl; break; case 4: cout<<"??\?????\ Sunday"<<endl; break; case 5: cout<<"????????\ Monday"<<endl; break; case 6: cout<<"????????\ Tuesday"<<endl; break; case 0: cout<<"?°´?????\ Wednesday"<<endl; break; }
a.cc: In function 'int main()': a.cc:49:31: warning: unknown escape sequence: '\040' 49 | cout<<"??<U+00A8>?????\ Thursday"<<endl; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:52:31: warning: unknown escape sequence: '\040' 52 | cout<<"????????\ Friday"<<endl; | ^~~~~~~~~~~~~~~~~~ a.cc:55:31: warning: unknown escape sequence: '\040' 55 | cout<<"????????\ Saturday"<<endl; | ^~~~~~~~~~~~~~~~~~~~ a.cc:58:31: warning: unknown escape sequence: '\040' 58 | cout<<"??\?????\ Sunday"<<endl; | ^~~~~~~~~~~~~~~~~~ a.cc:61:31: warning: unknown escape sequence: '\040' 61 | cout<<"????????\ Monday"<<endl; | ^~~~~~~~~~~~~~~~~~ a.cc:64:31: warning: unknown escape sequence: '\040' 64 | cout<<"????????\ Tuesday"<<endl; | ^~~~~~~~~~~~~~~~~~~ a.cc:67:31: warning: unknown escape sequence: '\040' 67 | cout<<"?<U+00B0><U+00B4>?????\ Wednesday"<<endl; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:69:18: error: expected '}' at end of input 69 | } | ^ a.cc:5:17: note: to match this '{' 5 | while(1){ | ^ a.cc:69:18: error: expected '}' at end of input 69 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s695743283
p00027
C++
# include <stdio.h> #include <iostream> using namespace std; int main() { int m,d; string week[7] = {"Thursday", "Friday", "Saturday", "Sunday","Mondy", "Tuesday", Wednesday"}; int month[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; while ( scanf("%d %d", &m, &d), m != 0 ) { int day = 0; for (int i = 0; i < (m - 1); i++) { day += month[i]; } day += d; cout << week[(day%7)-1] << endl; } return 0; }
a.cc:9:93: warning: missing terminating " character 9 | string week[7] = {"Thursday", "Friday", "Saturday", "Sunday","Mondy", "Tuesday", Wednesday"}; | ^ a.cc:9:93: error: missing terminating " character 9 | string week[7] = {"Thursday", "Friday", "Saturday", "Sunday","Mondy", "Tuesday", Wednesday"}; | ^~~ a.cc: In function 'int main()': a.cc:9:84: error: 'Wednesday' was not declared in this scope 9 | string week[7] = {"Thursday", "Friday", "Saturday", "Sunday","Mondy", "Tuesday", Wednesday"}; | ^~~~~~~~~ a.cc:10:3: error: expected '}' before 'int' 10 | int month[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | ^~~ a.cc:9:20: note: to match this '{' 9 | string week[7] = {"Thursday", "Friday", "Saturday", "Sunday","Mondy", "Tuesday", Wednesday"}; | ^ a.cc:10:3: error: expected ',' or ';' before 'int' 10 | int month[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | ^~~ a.cc:15:14: error: 'month' was not declared in this scope 15 | day += month[i]; | ^~~~~
s479401953
p00027
C++
from datetime import date import calendar while True: m, d = map(int, input().split()) if not m: break print(calendar.day_name[date(2004, m, d).weekday()])
a.cc:1:1: error: 'from' does not name a type 1 | from datetime import date | ^~~~
s554256829
p00027
C++
#include<iostream> using namespace std; int main() { int day,month,day while(cin>>month>>day&&month!=0) { switch(m) { cace 1 switch(date%7) { case 1; day=4; break; case 2; day=5; break; case 3; day=6; break; case 4; day=7; break; case 5; day=1; break; case 6; day=2; break; case 0; day=3; break; } break; case 2 switch(date%7) { case 1; day=7; break; case 2; day=1; break; case 3; day=2; break; case 4; day=3; break; case 5; day=4; break; case 6; day=5; break; case 0; day=6; break; } break; case 3 switch(date%7) { case 1; day=1; break; case 2; day=2; break; case 3; day=3; break; case 4; day=4; break; case 5; day=5; break; case 6; day=6; break; case 0; day=7; break; } break; case 4 switch(date%7) { case 1; day=4; break; case 2; day=5; break; case 3; day=6; break; case 4; day=7; break; case 5; day=1; break; case 6; day=2; break; case 0; day=3; break; } break; case 5 switch(date%7) { case 1; day=6; break; case 2; day=7; break; case 3; day=1; break; case 4; day=2; break; case 5; day=3; break; case 6; day=4; break; case 0; day=5; break; } break; case 6 switch(date%7) { case 1; day=2; break; case 2; day=3; break; case 3; day=4; break; case 4; day=5; break; case 5; day=6; break; case 6; day=7; break; case 0; day=1; break; } break; case 7 switch(date%7) { case 1; day=4; break; case 2; day=5; break; case 3; day=6; break; case 4; day=7; break; case 5; day=1; break; case 6; day=2; break; case 0; day=3; break; } break; case 8 switch(date%7) { case 1; day=7; break; case 2; day=1; break; case 3; day=2; break; case 4; day=3; break; case 5; day=4; break; case 6; day=5; break; case 0; day=6; break; } break; case 9 switch(date%7) { case 1; day=3; break; case 2; day=4; break; case 3; day=5; break; case 4; day=6; break; case 5; day=7; break; case 6; day=1; break; case 0; day=2; break; } break; case 10 switch(date%7) { case 1; day=5; break; case 2; day=6; break; case 3; day=7; break; case 4; day=1; break; case 5; day=2; break; case 6; day=3; break; case 0; day=4; break; } break; case 11 switch(date%7) { case 1; day=1; break; case 2; day=2; break; case 3; day=3; break; case 4; day=4; break; case 5; day=5; break; case 6; day=6; break; case 0; day=7; break; } break; case 12 switch(date%7) { case 1; day=3; break; case 2; day=4; break; case 3; day=5; break; case 4; day=6; break; case 5; day=7; break; case 6; day=1; break; case 0; day=2; break; } break; } switch(day) { case 1; cout<<"Monday"<<endl; break; case 2; cout<<"Tuesday"<<endl; break; case 3; cout<<"Wednesday"<<endl; break; case 4; cout<<"Thursday"<<endl; break; case 5; cout<<"Friday"<<endl; break; case 6; cout<<"Saturday"<<endl; break; case 7; cout<<"Sunday"<<endl; break; } } return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: expected initializer before 'while' 6 | while(cin>>month>>day&&month!=0) | ^~~~~
s268986094
p00027
C++
#include<iostream> #include<string> int monthes[]={0,31,29,31,30,31,30,31,31,30,31,30,31}; std::string day[]={"Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"}; int main(void){ int m,d,n; while(std::cin>>m>>d){ if(m==0&&d==0) break; n=0; int i; for(i=1;i<m;i++) n+=monthes[i]; n+=d std::cout<<day[n%7]<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:13: error: expected ';' before 'std' 15 | n+=d | ^ | ; 16 | std::cout<<day[n%7]<<std::endl; | ~~~
s768738613
p00027
C++
#include<stdio.h> #include<windows.h> void y(int x ){ if(x == 0) puts("Thursday"); else if(x == 1) puts("Friday"); else if(x == 2) puts("Saturday"); else if(x == 3) puts("Sunday"); else if(x == 4) puts("Monday"); else if(x == 5) puts("Tuesday"); else if(x == 6) puts("Wednesday"); } int main(void){ int M,D; while(1){ int date = 0,ans; int m[12] = {31,29,31,30,31,30,31,31,30,31,30,31}; scanf("%d%d", &M, &D); if(M == 0 && D == 0)break; for(int i = 1; i <= 12 ; i++){ for(int j = 1; j <= m[i-1]; j++){ if(i == M && j == D){ ans = date; } printf("%dŒŽ%d“ú%d\n",i,j,date%7); // y(date%7); date++; } Sleep(1000); } y(ans%7); } return 0; }
a.cc:2:9: fatal error: windows.h: No such file or directory 2 | #include<windows.h> | ^~~~~~~~~~~ compilation terminated.
s942320610
p00027
C++
#include <stdio.h> int total[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30}; int Sum(int x) { int i, sum = 0; for(i = 0; i < x; i ++) { sum += total[i]; } return sum; } int main() { int month, day; while(scanf("%d %d", &month, &day)) { if(month == 0) break; switch((Sum(month - 1) + day)%7) { case 0: printf("Thursday\n"); break; case 1: printf("Friday\n"); break; case 2: printf("Saturday\n"); break; case 3: printf("Sunday\n"); break;
a.cc: In function 'int main()': a.cc:34:15: error: expected '}' at end of input 34 | break; | ^ a.cc:19:38: note: to match this '{' 19 | switch((Sum(month - 1) + day)%7) { | ^ a.cc:34:15: error: expected '}' at end of input 34 | break; | ^ a.cc:16:39: note: to match this '{' 16 | while(scanf("%d %d", &month, &day)) { | ^ a.cc:34:15: error: expected '}' at end of input 34 | break; | ^ a.cc:14:12: note: to match this '{' 14 | int main() { | ^
s051386015
p00027
C++
#include <stdio.h> int total[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30}; int Sum(int x) { int i, sum = 0; for(i = 0; i < x; i ++) { sum += total[i]; } return sum; } int main() { int month, day; while(scanf("%d %d", &month, &day)) { if(month == 0) break; switch((Sum(month - 1) + day)%7) { case 0: printf("Thursday\n"); break; case 1: printf("Friday\n"); break; case 2: printf("Saturday\n"); break; case 3: printf("Sunday\n"); break;
a.cc: In function 'int main()': a.cc:34:15: error: expected '}' at end of input 34 | break; | ^ a.cc:19:38: note: to match this '{' 19 | switch((Sum(month - 1) + day)%7) { | ^ a.cc:34:15: error: expected '}' at end of input 34 | break; | ^ a.cc:16:39: note: to match this '{' 16 | while(scanf("%d %d", &month, &day)) { | ^ a.cc:34:15: error: expected '}' at end of input 34 | break; | ^ a.cc:14:12: note: to match this '{' 14 | int main() { | ^
s950127326
p00027
C++
case 6: printf("Tuesday\n"); break; } } return 0; }
a.cc:2:7: error: expected unqualified-id before 'case' 2 | case 6: | ^~~~ a.cc:4:9: error: expected unqualified-id before 'break' 4 | break; | ^~~~~ a.cc:5:5: error: expected declaration before '}' token 5 | } | ^ a.cc:6:3: error: expected declaration before '}' token 6 | } | ^ a.cc:8:3: error: expected unqualified-id before 'return' 8 | return 0; | ^~~~~~ a.cc:9:1: error: expected declaration before '}' token 9 | } | ^
s447907240
p00027
C++
#include<iostream> #include<string> using namespace std; int main(){ int a,b,day; string Day; int days[]={31,29,31,30,31,30,31,31,30,31,30,31}; string Days[]={Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday} while(cin>>a>>b){ day=4; for(int i=0;i<11;i++){ if(a>i+1)b+=days[i];} day+=b; day%=7; for(int i=0;i<7;i++){ if(day==i)Day=Days[i]} cout<<Day<<endl;}}
a.cc: In function 'int main()': a.cc:9:16: error: 'Sunday' was not declared in this scope 9 | string Days[]={Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday} | ^~~~~~ a.cc:9:23: error: 'Monday' was not declared in this scope 9 | string Days[]={Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday} | ^~~~~~ a.cc:9:30: error: 'Tuesday' was not declared in this scope 9 | string Days[]={Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday} | ^~~~~~~ a.cc:9:38: error: 'Wednesday' was not declared in this scope 9 | string Days[]={Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday} | ^~~~~~~~~ a.cc:9:48: error: 'Thursday' was not declared in this scope 9 | string Days[]={Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday} | ^~~~~~~~ a.cc:9:57: error: 'Friday' was not declared in this scope 9 | string Days[]={Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday} | ^~~~~~ a.cc:9:64: error: 'Saturday' was not declared in this scope 9 | string Days[]={Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday} | ^~~~~~~~ a.cc:11:1: error: expected ',' or ';' before 'while' 11 | while(cin>>a>>b){ | ^~~~~
s157182402
p00027
C++
#include <iostream> #include <string> using namespace std; int main(){ int n; int m; while(cin >>n>>m){ if(n==0){break;} if(n==2){n=m+31;} if(n==3){n=m+60;} if(n==4){n=m+91;} if(n==5){n=m+121;} if(n==6){n=m+152;} if(n==7){n=m+182;} if(n==8){n=m+213;} if(n==9){n=m+244;} if(n==10){n=m+274;} if(n==11){n=m+305;} if(n==12){n=m+335;} n=n%7; if(n==1){cout <<"Thursday"} if(n==2){cout <<"Friday"} if(n==3){cout <<"Saturday"} if(n==4){cout <<"Sunday"} if(n==5){cout <<"Monday"} if(n==6){cout <<"Tuesday"} if(n==0){cout <<"Wednesday"} cout <<endl;}}
a.cc: In function 'int main()': a.cc:21:27: error: expected ';' before '}' token 21 | if(n==1){cout <<"Thursday"} | ^ | ; a.cc:22:25: error: expected ';' before '}' token 22 | if(n==2){cout <<"Friday"} | ^ | ; a.cc:23:27: error: expected ';' before '}' token 23 | if(n==3){cout <<"Saturday"} | ^ | ; a.cc:24:25: error: expected ';' before '}' token 24 | if(n==4){cout <<"Sunday"} | ^ | ; a.cc:25:25: error: expected ';' before '}' token 25 | if(n==5){cout <<"Monday"} | ^ | ; a.cc:26:26: error: expected ';' before '}' token 26 | if(n==6){cout <<"Tuesday"} | ^ | ; a.cc:27:28: error: expected ';' before '}' token 27 | if(n==0){cout <<"Wednesday"} | ^ | ;
s313140540
p00027
C++
include<iostream> using namespace std; int main(){ int a[12] = {31,29,31,30,31,30,31,31,30,31,30,31}; int n,m,d; while(cin >> n >> m, n, m){ d = 0; for(int i=0;i<n-1;i++) d = a[i] + d; d = d + m; while(d > 6) d -= 7; if(d == 5) cout << "Monday" << endl; else if(d == 5) cout << "Tuesday" << endl; else if(d == 0) cout << "Wednesday" << endl; else if(d == 1) cout << "Thursday" << endl; else if(d == 2) cout << "Friday" << endl; else if(d == 3) cout << "Saturday" << endl; else if(d == 4) cout << "Sunday" << endl; } }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:9:9: error: 'cin' was not declared in this scope 9 | while(cin >> n >> m, n, m){ | ^~~ a.cc:19:16: error: 'cout' was not declared in this scope 19 | if(d == 5) cout << "Monday" << endl; | ^~~~ a.cc:19:36: error: 'endl' was not declared in this scope 19 | if(d == 5) cout << "Monday" << endl; | ^~~~ a.cc:20:21: error: 'cout' was not declared in this scope 20 | else if(d == 5) cout << "Tuesday" << endl; | ^~~~ a.cc:20:42: error: 'endl' was not declared in this scope 20 | else if(d == 5) cout << "Tuesday" << endl; | ^~~~ a.cc:21:21: error: 'cout' was not declared in this scope 21 | else if(d == 0) cout << "Wednesday" << endl; | ^~~~ a.cc:21:44: error: 'endl' was not declared in this scope 21 | else if(d == 0) cout << "Wednesday" << endl; | ^~~~ a.cc:22:21: error: 'cout' was not declared in this scope 22 | else if(d == 1) cout << "Thursday" << endl; | ^~~~ a.cc:22:43: error: 'endl' was not declared in this scope 22 | else if(d == 1) cout << "Thursday" << endl; | ^~~~ a.cc:23:21: error: 'cout' was not declared in this scope 23 | else if(d == 2) cout << "Friday" << endl; | ^~~~ a.cc:23:41: error: 'endl' was not declared in this scope 23 | else if(d == 2) cout << "Friday" << endl; | ^~~~ a.cc:24:21: error: 'cout' was not declared in this scope 24 | else if(d == 3) cout << "Saturday" << endl; | ^~~~ a.cc:24:43: error: 'endl' was not declared in this scope 24 | else if(d == 3) cout << "Saturday" << endl; | ^~~~ a.cc:25:21: error: 'cout' was not declared in this scope 25 | else if(d == 4) cout << "Sunday" << endl; | ^~~~ a.cc:25:41: error: 'endl' was not declared in this scope 25 | else if(d == 4) cout << "Sunday" << endl; | ^~~~
s480664622
p00027
C++
#include<stdio.h> int main(void) { int a=0,b=0,day=0; while(day != 10) { scnaf("%d %d",&a,&b); if(a==0 || b ==0)break; else if(a==1 || a==4 || a==7) day = 3 + b % 7; else if(a==2 || a==8) day = 6 + b % 7; else if(a==3 || a==11) day = b % 7; else if(a==5) day = 5 + b % 7; else if(a == 6) day = 1 + b % 7; else if(a==9 || a==12) day = 2 + b % 7; else day = 4 + b % 7; if(day > 6) day-=7; switch (day) { case 1: printf("Monday\n"); break; case 2: printf("Tuesday\n"); break; case 3: printf("Wednesday\n"); break; case 4: printf("Thursday\n"); break; case 5: printf("Friday\n"); break; case 6: printf("Saturday\n"); break; case 0: printf("Sunday\n"); break; } } return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: 'scnaf' was not declared in this scope; did you mean 'scanf'? 9 | scnaf("%d %d",&a,&b); | ^~~~~ | scanf
s975293944
p00027
C++
#include <vector> #include <utility> using namespace std; typedef pair<int,int> MonthDay; int main(){ int monthnum[]={ 31,29,31,30,31,30,31,31,30,31,30,31 }; const string weekname[]={ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" }; vector<MonthDay> data; int month,day; while(cin>>month>>day){ if(!month)break; data.push_back(MonthDay(month,day)); } for(int i=0;i<data.size();i++){ int daysum=0; for(int j=0;j<data[i].first-1;j++){ daysum+=monthnum[j]; } daysum+=data[i].second; int weekindex=(daysum+2)%7; cout<<weekname[weekindex]<<endl; } }
a.cc: In function 'int main()': a.cc:9:9: error: 'string' does not name a type 9 | const string weekname[]={ | ^~~~~~ a.cc:20:9: error: 'cin' was not declared in this scope 20 | while(cin>>month>>day){ | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <utility> +++ |+#include <iostream> 3 | using namespace std; a.cc:31:5: error: 'cout' was not declared in this scope 31 | cout<<weekname[weekindex]<<endl; | ^~~~ a.cc:31:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:31:11: error: 'weekname' was not declared in this scope 31 | cout<<weekname[weekindex]<<endl; | ^~~~~~~~ a.cc:31:32: error: 'endl' was not declared in this scope 31 | cout<<weekname[weekindex]<<endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include <utility> +++ |+#include <ostream> 3 | using namespace std;
s975066008
p00028
Java
import java.util.Scanner; public class AOJ_Volume0028 { public static void main(String[] args){ @SuppressWarnings("resource") Scanner sc = new Scanner(System.in); int[] count = new int[101]; int max,value; while(sc.hasNext()){ value = sc.nextInt(); count[value]++; } max = count[0]; for(int i=0;i<100;i++){ if(max < count[i]) max = count[i]; } for(int i=0;i<100;i++){ if(max == count[i]) System.out.println(i); } } }
Main.java:4: error: class AOJ_Volume0028 is public, should be declared in a file named AOJ_Volume0028.java public class AOJ_Volume0028 { ^ 1 error
s214628988
p00028
Java
import java.util.Scanner; public class AOJ0028 { public static void main(String[] args){ Scanner input = new Scanner(System.in); int cnt[] = new int[100]; while (input.hasNext()){ int n = input.nextInt(); cnt[--n]++; } int max = 0; for (int n : cnt){ if (max < n){ max = n; } } for (int i = 0; i < cnt.length; i++){ if (cnt[i] == max){ System.out.println(i + 1); } } } }
Main.java:3: error: class AOJ0028 is public, should be declared in a file named AOJ0028.java public class AOJ0028 { ^ 1 error
s582298309
p00028
Java
import java.util.Scanner; public class AOJ0028 { public static void Main(String[] args){ Scanner input = new Scanner(System.in); int cnt[] = new int[100]; while (input.hasNext()){ int n = input.nextInt(); cnt[--n]++; } int max = 0; for (int n : cnt){ if (max < n){ max = n; } } for (int i = 0; i < cnt.length; i++){ if (cnt[i] == max){ System.out.println(i + 1); } } } }
Main.java:3: error: class AOJ0028 is public, should be declared in a file named AOJ0028.java public class AOJ0028 { ^ 1 error
s335271701
p00028
Java
import java.util.*; public class Scanstr { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int max = 0; int[] num; num = new int[101]; Scanner input = new Scanner(System.in); while (input.hasNext()){ int n = input.nextInt(); num[n]++; if (max < num[n]){ max = num[n]; } } for (int i = 1; i <= 100; i++){ if (num[i] == max){ System.out.println(i); } } } }
Main.java:2: error: class Scanstr is public, should be declared in a file named Scanstr.java public class Scanstr { ^ 1 error
s858656377
p00028
Java
import java.util.*; public class Scanstr { public static void main(String[] args) { // TODO code application logic here int max = 0; int[] num; num = new int[101]; Scanner input = new Scanner(System.in); while (input.hasNext()){ int n = input.nextInt(); num[n]++; if (max < num[n]){ max = num[n]; } } for (int i = 1; i <= 100; i++){ if (num[i] == max){ System.out.println(i); } } } }
Main.java:2: error: class Scanstr is public, should be declared in a file named Scanstr.java public class Scanstr { ^ 1 error
s407719839
p00028
Java
import java.util.*; public class Scanstr { public static void main(String[] args) { int max = 0; int[] num; num = new int[101]; Scanner input = new Scanner(System.in); while (input.hasNext()){ int n = input.nextInt(); num[n]++; if (max < num[n]){ max = num[n]; } } for (int i = 1; i <= 100; i++){ if (num[i] == max){ System.out.println(i); } } } }
Main.java:2: error: class Scanstr is public, should be declared in a file named Scanstr.java public class Scanstr { ^ 1 error
s169484628
p00028
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BuferedReader(new InputStreamReader(System.in)); String line; int count[]=new int[101]; int max=0; while((line=br.nextLine())!=null){ count[Integer.parseInt(line)]++; } for(int i=1;i<=100;i++){ max=Math.max(max,count[i]); } for(int i=0;i<=100;i++){ if(count[i]==max){ Sysem.out.println(i); } } } }
Main.java:5: error: cannot find symbol BufferedReader br=new BuferedReader(new InputStreamReader(System.in)); ^ symbol: class BuferedReader location: class Main Main.java:9: error: cannot find symbol while((line=br.nextLine())!=null){ ^ symbol: method nextLine() location: variable br of type BufferedReader Main.java:17: error: package Sysem does not exist Sysem.out.println(i); ^ 3 errors
s145980068
p00028
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; int count[]=new int[101]; int max=0; while((line=br.nextLine())!=null){ count[Integer.parseInt(line)]++; } for(int i=1;i<=100;i++){ max=Math.max(max,count[i]); } for(int i=0;i<=100;i++){ if(count[i]==max){ System.out.println(i); } } } }
Main.java:9: error: cannot find symbol while((line=br.nextLine())!=null){ ^ symbol: method nextLine() location: variable br of type BufferedReader 1 error
s361220121
p00028
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; int count[]=new int[101]; int max=0; while((line=br.readLine())!=null){ count[Integer.parseInt(line)]++; } for(int i=1;i<=100;i++){ max=Math.max(max,count[i]); } for(int i=0;i<=100;i++){ if(count[i]==max){ System.out.println(i); } } } }
Main.java:9: error: unreported exception IOException; must be caught or declared to be thrown while((line=br.readLine())!=null){ ^ 1 error
s655052567
p00028
Java
import java.util.*; import java.io.*; public class Mode { public static void main(String[] args) throws Exception{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = in.readLine(); int[] arr = new int[100]; for (int i = 0; i < 100; i++) { arr[i] = 0; } while(line != null) { StringTokenizer tk = new StringTokenizer(line); int n = Integer.parseInt(tk.nextToken()); arr[n]++; line = in.readLine(); } LinkedList<Integer> l = new LinkedList<Integer>(); int mode = 0; for (int i = 0; i < 100; i++) { if (arr[i] == mode) { l.add(i+1); } else if(arr[i] > mode){ l = new LinkedList<Integer>(); l.add(i+1); mode = arr[i]; } } while(!l.isEmpty()) { System.out.println(l.remove()); } } }
Main.java:3: error: class Mode is public, should be declared in a file named Mode.java public class Mode { ^ 1 error
s580700905
p00028
Java
class Main { public static void main(String[] args) { Scanner sc = null; Map<Integer, Integer> nums = new HashMap<Integer, Integer>(); try { sc = new Scanner(System.in); int maxValue = 0; while (sc.hasNextInt()) { int num = sc.nextInt(); nums.put(num, nums.containsKey(num) ? nums.get(num) + 1 : 1); if (maxValue < nums.get(num)) { maxValue = nums.get(num); } } Arrays.sort(nums.keySet().toArray()); for (Entry<Integer, Integer> entry : nums.entrySet()) { if (maxValue == entry.getValue()) { System.out.println(entry.getKey()); } } } finally { sc.close(); } } }
Main.java:5: error: cannot find symbol Scanner sc = null; ^ symbol: class Scanner location: class Main Main.java:6: error: cannot find symbol Map<Integer, Integer> nums = new HashMap<Integer, Integer>(); ^ symbol: class Map location: class Main Main.java:6: error: cannot find symbol Map<Integer, Integer> nums = new HashMap<Integer, Integer>(); ^ symbol: class HashMap location: class Main Main.java:8: error: cannot find symbol sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:17: error: cannot find symbol Arrays.sort(nums.keySet().toArray()); ^ symbol: variable Arrays location: class Main Main.java:18: error: cannot find symbol for (Entry<Integer, Integer> entry : nums.entrySet()) { ^ symbol: class Entry location: class Main 6 errors
s055217221
p00028
Java
import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; import java.io.File; import java.io.FileReader; import java.io.FileNotFoundException; public class Main { public static void main(String args[] ) throws IOException { BufferedReader br; //input.txt??????????????? br = InputFile.load(); //?¨??????\??? //BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = ""; int[] list = new int[9]; while((s = br.readLine()) != null){ int n = Integer.parseInt(s); list[(n-1)] += 1; } int max = 0; for ( int l: list) { if (l > max) { max = l; } } for (int i = 0; i < 9; i++) { if (list[i] == max) { System.out.println(i+1); } } } }
Main.java:13: error: cannot find symbol br = InputFile.load(); ^ symbol: variable InputFile location: class Main 1 error
s583236428
p00028
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] array = new int[100]; while (sc.hasNext()) { int number = Integer.parseInt(sc.nextLine()); array[number-1] += number; } for(int i = 0 ; i < array.length ; i++){ if(array[i] > 0 ){ array[i] /= i+1; } } int max = 0; for(int ary : array){ if (ary > max) { max = ary; } } for (int i = 0; i < array.length; i++) { if(array[i] == max){ System.out.println(i+1); } } } }
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s457050037
p00028
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Map; import java.util.HashMap; public class Main{ static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException{ int num[] = new int[101]; while((String price = br.readLine()) != null){ num[Integer.parseInt(price)]++; } int max = -1; for(int i = 1;i <= num.length;i++){ if(max<num[i]) max = num[i]; } for(int i = 1;i <= num.length;i++){ if(max == num[i]) System.out.println(num[i]); } } }
Main.java:15: error: ',', ')', or '[' expected while((String price = br.readLine()) != null){ ^ Main.java:15: error: illegal start of expression while((String price = br.readLine()) != null){ ^ Main.java:15: error: illegal start of expression while((String price = br.readLine()) != null){ ^ Main.java:15: error: ';' expected while((String price = br.readLine()) != null){ ^ 4 errors
s180448166
p00028
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ int[] count = new int[100]; int max = 0; while(scan.hasNext()){ int a = scan.nextInt(); count[a-1]++; if(count[a-1] > max){ max = count[a-1]: } } for(int i = 0; i < 100; i++){ if(count[i] == max){ System.out.printf("%d\n", i+1); } } } }
Main.java:13: error: ';' expected max = count[a-1]: ^ 1 error
s392432046
p00028
Java
import java.io.BufferedReader; import java.io.InputStreamReader; //1???100?????´??°???????????????????????????????????????????????????????????? public class Q0028_ModeValue { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("????????????????????°??\???"); int ds = Integer.parseInt(br.readLine()); // ??????????????????????????°???????????????????´? Integer[] num = new Integer[ds]; for (int i = 0; i < ds; i++) { num[i] = (int) (Math.random() * 9) + 1; System.out.println(num[i]); } System.out.print("????????????"); // ??°?????????????????????????????????count?????????????´? int[] count = new int[ds]; for (int i = 0; i < num.length; i++) { for (int j = 0; j < num.length; j++) { if (num[i] == num[j]) { count[i]++; } } } // count??????????????§???????±??????? int max=count[0]; for (int i = 1; i < count.length; i++) { if(count[i] > count[i-1]){ //?????§??????i???max?????£??\ max = i; } } System.out.println(num[max]); } }
Main.java:8: error: illegal escape character System.out.println("???????????????????????\???"); ^ 1 error
s844037070
p00028
Java
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { Scanner input = new Scanner(System.in); ArrayList<Integer> result = new ArrayList<Integer>(); HashMap<Integer,Integer> count = new HashMap<Integer,Integer>(); int maxCount = 0; while (input.hasNext()) { int number = input.nextInt(); if(count.containsKey(number)) { count.put(number, count.get(number) + 1); maxCount = Math.max(maxCount, count.get(number) + 1); } else { count.put(number, 1); } for(Map.Entry<Integer,Integer> entry : count.entrySet()) { if(entry.getValue == maxCount) { result.add(entry.getKey()); } } } Collections.sort(result); for(int i = 0; i < result.size(); i++) { System.out.println(result.get(i)); } } }
Main.java:22: error: cannot find symbol if(entry.getValue == maxCount) { ^ symbol: variable getValue location: variable entry of type Entry<Integer,Integer> 1 error
s815652640
p00028
Java
import java.util.List; import java.util.ArrayList; import java.util.Scanner; public class Test { public static void main(String args[]){ Scanner stdIn = new Scanner(System.in); int[] intArray = new int[100]; while(stdIn.hasNext()){ intArray[stdIn.nextInt()-1]++; } int[] indexArray = indexOfMaxArrayNumber(intArray); for(int i:indexArray){ System.out.println(i); } } //受け取った配列のなかで、最大の値を持っている要素の添え字+1を配列にして返す //最大の値が複数あったときは、添え字+1の値を小さい順に配列に格納して返す public static int[] indexOfMaxArrayNumber(int[] intArray){ List<Integer> indexList = new ArrayList<Integer>(); int max = 0; //intArrayの最大値を求める for(int i:intArray){ max = Math.max(i, max); } for(int i = 0;i < intArray.length; i++){ if(intArray[i] == max){ indexList.add(i + 1); } } int[] indexArray = new int[indexList.size()]; for(int i = 0;i < indexArray.length; i++){ indexArray[i] = indexList.get(i); } return indexArray; } }
Main.java:5: error: class Test is public, should be declared in a file named Test.java public class Test { ^ 1 error
s058456461
p00028
Java
import java.io.*; import java.util.Scanner; class Main{ public static void main(String[] args)throws IOException{ Scanner scan = new Scanner(System.in); int[] list = new int[100]; while(scan.hasNextInt()){ list[scan.nextInt()-1]++; } int max =0; for(int i=0;i<list.length;i++){ max =Math.Max(max , list[i]); } for(int i=0;i<list.length;i++){ if(max ==list[i]){ System.out.printf("%f\n",(i+1)); } } } }
Main.java:12: error: cannot find symbol max =Math.Max(max , list[i]); ^ symbol: method Max(int,int) location: class Math 1 error
s766370070
p00028
C
#include<stdio.h> int main(void) { int impo,in[101]={0},i,j,f=0,s=1,t=2; for(i=0;scanf("%d",&impo)!=EOF;i++) { in[impo]++; } if(in[0]<in[1]) { f=1; s=0; } else if(in[0]>=in[1]) { f=0; s=1; } for(i=2;i<101;i++) { if(in[s]<in[i]) { if(in[f]<in[i]) { s=f; j=f; f=i; } else { j=i; s=j; } } } if(a[f]==a[s]) { if(a[f]<a[s]) { j=f; f=s; s=j; } printf("%d\n%d\n",f,s); } else { printf("%d\n",f); } return 0; }
main.c: In function 'main': main.c:36:8: error: 'a' undeclared (first use in this function) 36 | if(a[f]==a[s]) | ^ main.c:36:8: note: each undeclared identifier is reported only once for each function it appears in
s505422842
p00028
C
include <stdio.h> int main() { int data[128] = {0}; int max = 0; int i; while(scanf("%d", &i) != EOF) { data[i]++; if(data[i] > max) max = data[i]; } for(i = 0; i < 101; i++) { if(data[i] == max) printf("%d\n", i); } return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s058994148
p00028
C
#include<stdio.h> int main(void) { int max=0,a,i; int count[101]={0}; while(scanf("%d",&a)!=EOF){ count[a]++; if(max<count[a]) max=count[a]; } for(i=0;i<100;i++){ if(max==count[i]){ printf("%d\n",i); } return 0; }
main.c: In function 'main': main.c:16:1: error: expected declaration or statement at end of input 16 | } | ^
s970452555
p00028
C
#include <bits/stdc++.h> using namespace std; int main(){ int t[102]={},tmp,k = 0,i; while(cin>>tmp){ t[tmp+1]++; if(t[tmp+1]>k){ k = t[tmp+1]; } } for(i = 1;i <= 102;i++){ if(t[i] == k){ cout<<i-1<<endl; } } return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s867739721
p00028
C
#include <bits/stdc++.h> using namespace std; int main(){ int t[102]={},tmp,k = 0,i; while(cin>>tmp){ t[tmp+1]++; if(t[tmp+1]>k){ k = t[tmp+1]; } } for(i = 1;i <= 102;i++){ if(t[i] == k){ cout<<i-1<<endl; } } return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s692641027
p00028
C
#include<stdio.h> #include<iostream> using namespace std; int main(){ int j,k; int v[200]={0}; int a; int max=0; while((scanf("%d",&a)!=EOF)){ v[a-1]++; } for(k=0;k<100;k++){ if(max < v[k]) max = v[k]; } for(k=0;k<100;k++){ if(v[k]==max) printf("%d\n",k+1); } return 0; }
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s581136858
p00028
C
#include <iostream> using namespace std; int main(){ int num, max; int list[100] = {0}; max = 0; while (cin >> num){ list[num - 1]++; } for (int i = 0; i < 100; i++){ if (max < list[i]){ max = list[i]; } } for (int j = 0; j < 100; j++){ if (max == list[j]){ cout << j + 1 << endl; } } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s849512654
p00028
C
int main(void){ int i, sum[1000],ma, a, key, MAX; for(i = 0; i < 100; i++){ sum[i] = 0; } while(scanf("%d", &a) != EOF){ sum[a - 1]++; } MAX = sum[0]; key = 1; for(i = 0; i < 100; i++){ if(sum[i] > MAX){ MAX = sum[i]; key = i + 1; } } printf("%d", key); return 0; }
main.c: In function 'main': main.c:6:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while(scanf("%d", &a) != EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void){ main.c:6:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while(scanf("%d", &a) != EOF){ | ^~~~~ main.c:6:10: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:29: error: 'EOF' undeclared (first use in this function) 6 | while(scanf("%d", &a) != EOF){ | ^~~ main.c:6:29: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:6:29: note: each undeclared identifier is reported only once for each function it appears in main.c:17:4: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 17 | printf("%d", key); | ^~~~~~ main.c:17:4: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:17:4: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:17:4: note: include '<stdio.h>' or provide a declaration of 'printf'
s196440672
p00028
C
int main(void){ int i, sum[1000],???a, key, MAX; for(i = 0; i < 100; i++){ sum[i] = 0; } while(scanf("%d", &a) != EOF){ sum[a - 1]++; } MAX = sum[0]; key = 1; for(i = 0; i < 100; i++){ if(sum[i] > MAX){ MAX = sum[i]; key = i + 1; } } printf("%d", key); return 0; }
main.c: In function 'main': main.c:2:21: error: expected identifier or '(' before '?' token 2 | int i, sum[1000],???a, key, MAX; | ^ main.c:6:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while(scanf("%d", &a) != EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void){ main.c:6:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while(scanf("%d", &a) != EOF){ | ^~~~~ main.c:6:10: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:23: error: 'a' undeclared (first use in this function) 6 | while(scanf("%d", &a) != EOF){ | ^ main.c:6:23: note: each undeclared identifier is reported only once for each function it appears in main.c:6:29: error: 'EOF' undeclared (first use in this function) 6 | while(scanf("%d", &a) != EOF){ | ^~~ main.c:6:29: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:9:4: error: 'MAX' undeclared (first use in this function) 9 | MAX = sum[0]; | ^~~ main.c:10:4: error: 'key' undeclared (first use in this function) 10 | key = 1; | ^~~ main.c:17:4: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 17 | printf("%d", key); | ^~~~~~ main.c:17:4: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:17:4: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:17:4: note: include '<stdio.h>' or provide a declaration of 'printf'
s274448237
p00028
C
int main(void){ int i, sum[1000], a, key, MAX; for(i = 0; i < 100; i++){ sum[i] = 0; } while(scanf("%d", &a) != EOF){ sum[a - 1]++; } MAX = sum[0]; key = 1; for(i = 0; i < 100; i++){ if(sum[i] > MAX){ MAX = sum[i]; } } for(i = 0; i < 100; i++){ if(sum[i] == MAX){ printf("%d", i); } } return 0; }
main.c: In function 'main': main.c:6:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while(scanf("%d", &a) != EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void){ main.c:6:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while(scanf("%d", &a) != EOF){ | ^~~~~ main.c:6:10: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:29: error: 'EOF' undeclared (first use in this function) 6 | while(scanf("%d", &a) != EOF){ | ^~~ main.c:6:29: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:6:29: note: each undeclared identifier is reported only once for each function it appears in main.c:18:10: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 18 | printf("%d", i); | ^~~~~~ main.c:18:10: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:18:10: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:18:10: note: include '<stdio.h>' or provide a declaration of 'printf'
s934284939
p00028
C
#include<iostream> using namespace std; int main() { int a[100+1]={0}; int t; while(~scanf("%d",&t)) a[t]++; int max=0; for(int i=0;i<101;i++) if(a[i]>max) max=a[i]; for(int i=0;i<101;i++) if(a[i]==max) cout<<i<<endl; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s737043375
p00028
C
#include <iostream> using namespace std; int main() { int cnt[100] = {0}; int num; int max_v = 0; while(cin >> num) { cnt[num-1]++; max_v = max(max_v, cnt[num-1]); } for (int i=0; i<100; i++) { if (cnt[i] == max_v) cout << i+1 << endl; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s075120114
p00028
C
#include "stdafx.h" int main() { int a[100] = { 0 }, i, max=0; while (scanf("%d", &i) != EOF) a[i - 1]++; for (i = 0; i < 100; i++) if (max < a[i]) max = a[i]; for (i = 0; i < 100; i++) if (max == a[i]) prinf("%d\n", i + 1); return 0; }
main.c:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s400129702
p00028
C
#include<stdio.h> int main() { int a[100] = { 0 }, i, max=0; while (scanf("%d", &i) != EOF) a[i - 1]++; for (i = 0; i < 100; i++) if (max < a[i]) max = a[i]; for (i = 0; i < 100; i++) if (max == a[i]) prinf("%d\n", i + 1); return 0; }
main.c: In function 'main': main.c:11:34: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration] 11 | if (max == a[i]) prinf("%d\n", i + 1); | ^~~~~ | printf
s040558808
p00028
C
a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););}
main.c:1:1: warning: data definition has no type or storage class 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:5: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^ main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:37: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} main.c:1:37: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~ main.c:1:37: note: include '<math.h>' or provide a declaration of 'fmax' main.c:1:37: error: too few arguments to function 'fmax' main.c:1:69: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~~~ main.c:1:69: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:69: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:69: note: include '<stdio.h>' or provide a declaration of 'printf' main.c: At top level: main.c:1:1: warning: array 'a' assumed to have one element 1 | a[],i;main(m){for(;~scanf("%d",a)?m=fmax(++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^
s551128111
p00028
C
a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););}
main.c:1:1: warning: data definition has no type or storage class 1 | a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:5: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^ main.c:1:7: error: return type defaults to 'int' [-Wimplicit-int] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~ main.c: In function 'main': main.c:1:7: error: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:21: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} main.c:1:21: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:37: error: implicit declaration of function 'max' [-Wimplicit-function-declaration] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~ main.c:1:70: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^~~~~~ main.c:1:70: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:70: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:70: note: include '<stdio.h>' or provide a declaration of 'printf' main.c: At top level: main.c:1:1: warning: array 'a' assumed to have one element 1 | a[],i;main(m){for(;~scanf("%d",a)?m=max(m,++a[*a]):i++>99?!i:m-a[i]||printf("%d\n",i););} | ^
s505314721
p00028
C
#include <stdio.h> int main(){ int x[101]={}; int y[101]={}; int n,i,j; while(scanf("%d",&n) != EOF){ x[n]++; } for(i=0;i<101;i++){ for(j=0;j<101 && j != i;j++){ if(x[i]<x[j]){ y[i]++; } } for(i=0;i<101;i++){ if(y[i]==0) printf("%d\n",i); } return 0; }
main.c: In function 'main': main.c:20:1: error: expected declaration or statement at end of input 20 | } | ^
s390885529
p00028
C
#include <stdio.h> int main(){ int x[101]={}; int y[101]={}; int n,i,j; while(scanf("%d",&n) != EOF){ x[n]++; } for(i=0;i<101;i++){ for(j=0;j<101;j++){ if(x[i]<x[j]){ y[i]++; } } for(i=0;i<101;i++){ if(y[i]==0) printf("%d\n",i); } return 0; }
main.c: In function 'main': main.c:20:1: error: expected declaration or statement at end of input 20 | } | ^
s671689371
p00028
C
include<stdio.h> int main() { int a[101]={0},b[101]={-1}; int i,j=0,inp,max=0; while(scanf("%d",&inp) != EOF) { if(inp<0 || inp>100) continue; a[inp]++; } for(i=0;i<101;i++) { if(max<a[i]) { max=a[i]; } } for(i=0;i<101;i++) { if(max==a[i]) { printf("%d\n",i); } } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s955844721
p00028
C
#include<stdio.h> int main(){ int a[100],g,y,i=0; a[100]={0}; g=0; while(scanf("%d",&i)!=EOF){ a[i]++; } for(i=0;i<100;i++){ if(a[i]>g){ g=a[i]; y=i; } } printf("%d\n",y); return (0); }
main.c: In function 'main': main.c:4:8: error: expected expression before '{' token 4 | a[100]={0}; | ^ main.c:16:7: error: stray '\343' in program 16 | return<U+3000>(0); | ^~~~~~~~
s789710196
p00028
C
#include<stdio.h> int main(void) { int x[101]={0},int y[101]={0}; int i=0,max; while(scanf("%d",&x[i])!=EOF) { y[x[i]] ++; i ++; } max = y[0]; for(i=1; i<101; i++){ if(max < y[i]) max = y[i]; } //maxは、数字のカウントの最大。つまり、何回カウントしたか。 for(i=0; i<101; i++){ if(max == y[i]) //カウント数が等しかったら、 { printf("%d\n",i); //添字を出力する。 } } return 0; }
main.c: In function 'main': main.c:4:17: error: expected identifier or '(' before 'int' 4 | int x[101]={0},int y[101]={0}; | ^~~ main.c:8:4: error: 'y' undeclared (first use in this function) 8 | y[x[i]] ++; | ^ main.c:8:4: note: each undeclared identifier is reported only once for each function it appears in
s528498666
p00028
C++
#include<bits/stdc++.h> using namespace std; int main() { int n; while(scanf("%d",&n)!=EOF) { int num[1000]={0}; for(int i=1;i<=n;i++) { int a; cin>>a; num[a]++; } int ans=0,now=0; for(int i=1;i<=105;i++) { if(num[i]>ans) { ans=num[i]; now=i; } } cout<<now<<endl; } }
a.cc: In function 'int main()': a.cc:21:5: error: 'i\U0000ff1b' was not declared in this scope 21 | now=i; | ^~~
s528644343
p00028
C++
#include<iostream> #include<vector> using namespace std; int main(){ vector<int>Times(101,0); int x; while(cin >> x){ cin>>x; Times[x]+=1; } int ma =-1 for(int x=1; x<=100; x++){ if(ma<Times[x]) ma=Times[x] } for(int x=1; x<=100; x++){ if(Times[x] == ma) cout << x << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:5: error: expected ',' or ';' before 'for' 15 | for(int x=1; x<=100; x++){ | ^~~ a.cc:15:29: error: expected ';' before ')' token 15 | for(int x=1; x<=100; x++){ | ^ | ;
s426698308
p00028
C++
#include<iostream> #include<cstdio> #include<vector> using namespace std; int main() { int a[100]; for(int i=0;i<100;i++)a[i]=0; int n; while(cin >> n){ a[n-1]++; } int ans=0; for(int i=1;i<100;i++){ if(a[ans]<a[i])ans=i; } cout << i+1 << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:17:9: error: 'i' was not declared in this scope 17 | cout << i+1 << "\n"; | ^
s566223990
p00028
C++
#include <algorithm> #include <functional> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <sstream> #include <iostream> #include <iomanip> #include <vector> #include <list> #include <stack> #include <queue> #include <map> #include <set> #include <bitset> #include <climits> #define all(c) (c).begin(), (c).end() #define rep(i,n) for(int i=0;i<(n);i++) #define pb(e) push_back(e) #define mp(a, b) make_pair(a, b) #define fr first #define sc second const int INF=100000000; int dx[4]={1,0,-1,0}; int dy[4]={0,1,0,-1}; using namespace std; typedef pair<int ,int > P; typedef long long ll; int ary[105]; int main() { int a; while(cin>>a) { ary[a]++; } int maxi = max_element(ary,ary+105); rep(i,105) { if(maxi==ary[i]) { cout<<i<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:40:27: error: invalid conversion from 'int*' to 'int' [-fpermissive] 40 | int maxi = max_element(ary,ary+105); | ~~~~~~~~~~~^~~~~~~~~~~~~ | | | int*
s858643183
p00028
C++
#include <stdio.h> int main() { int n; int a[100+1]; int max = 0; for(int i = 0; i < 101; i++){ a[i] = 0; } while(scanf("%d",&n) != EOF){ a[n]++; } for(int i = 0; i < 101; i++){ if(max < a[i]){ max = a[i]; } } for(int i = 0; i < 101; i++){ if(max == a[i]){ printf("%d\n",i); } } Sleep(2000); return 0; }
a.cc: In function 'int main()': a.cc:24:9: error: 'Sleep' was not declared in this scope 24 | Sleep(2000); | ^~~~~
s675620841
p00028
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> Vec(100); int n; while(cin>>n){ Vec[n]++; } int max_r = 0, ans; for(int i=0;i<100;i++){ max_r = max( max_r, Vec[i]); } for(int i=0;i<100;i++){ if(max_r == Vec[i]){ ans = i; } } cout<<i<<endl; return 0; }
a.cc: In function 'int main()': a.cc:22:15: error: 'i' was not declared in this scope 22 | cout<<i<<endl; | ^
s140080394
p00028
C++
#include <string> #include <vector> #include <algorithm> #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <queue> #include <map> #define INF 100000000 #define rep(i,a) for(int i=0;i<(a);i++) using namespace std; typedef long long ll; int main(){ queue<int> ans; int ma=-1; map<int,int> map; map.clear(); int tmp; while(cin>>tmp){ map[tmp]++; } rep(i,map.size()){ if(ma<map[i]) } }
a.cc: In function 'int main()': a.cc:29:5: error: expected primary-expression before '}' token 29 | } | ^
s476364670
p00028
C++
#include <iostream> using namespace std; int main(){ int hist[100]; for(int i=0; i<100;i++) hist[i] = 0; int n; while(cin >> n) hist[n]++; int maxv = 0; for(int i=0;i<100;i++){ if(ans[i] > maxv) maxv = ans[i]; } for(int i=0;i<100;i++){ if(maxv == hist[i]) cout << i << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:8: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | if(ans[i] > maxv) maxv = ans[i]; | ^~~ | abs
s840466638
p00028
C++
#include <iostream> using namespace std; int main(){ int hist[100]; for(int i=0; i<100;i++) hist[i] = 0; int n; while(cin >> n) hist[n]++; int maxv = 0; for(int i=0;i<100;i++){ if(ans[i] > maxv) maxv = hist[i]; } for(int i=0;i<100;i++){ if(maxv == hist[i]) cout << i << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:8: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | if(ans[i] > maxv) maxv = hist[i]; | ^~~ | abs
s400687665
p00028
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int sum[101],n,mx,cou; int main(){ while(cin>>n){ sum[n]++; } for(int i=0;i<100;i++)mx=max(mx,sum[i]); for(int i=0;i<100;i++){ if(mx==sum[i]){ cout<<i<<endl; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s824679974
p00028
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int sum[101],n,mx,cou; int main(){ while(cin>>n){ sum[n]++; } for(int i=0;i<100;i++)mx=max(mx,sum[i]); for(int i=0;i<100;i++){ if(mx==sum[i]){ cout<<i<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s292310414
p00028
C++
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); int cnt[] = new int[100]; while (input.hasNext()){ int n = input.nextInt(); cnt[--n]++; } int max = 0; for (int n : cnt){ if (max < n){ max = n; } } for (int i = 0; i < cnt.length; i++){ if (cnt[i] == max){ System.out.println(i + 1); } } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s681423622
p00028
C++
#include <iostream> //using namespace std; #define N 100 #define MYSCAN scanf_s int main(void){ int i; int input, max = 0; int bucket[N + 1]; // テゥツ?催・ツ按療」ツ?ョテ・ツ按敕ヲツ慊淌・ツ個? for (int i = 0; i < N + 1; i++){ bucket[i] = 0; } // テ・ツ?・テ・ツ環崚」ツ?ォテ」ツ?療」ツ?淌」ツ?古」ツ?」テ」ツ?ヲテゥツ??ヲツャツ。テゥツ?催・ツ按療」ツつ津」ツつォテ」ツつヲテ」ツδウテ」ツδ暗」ツつ「テ」ツδε」ツδ? while (MYSCAN("%d", &input) != EOF){ bucket[input]++; } // テ」ツつづ」ツ?」テ」ツ?ィテ」ツつづ・ツ、ツ堙」ツ?湘・ツ?コテ」ツ?淌・ツ崢榲ヲツ閉ーテ」ツつ津ヲツアツづ」ツつ?」ツつ? for (int i = 0; i < N + 1; i++){ if (max < bucket[i]){ max = bucket[i]; } } // テ」ツ?敕」ツ?ョテ・ツ崢榲ヲツ閉ーテ」ツ??」ツ?妥・ツ?・テ・ツ環崚」ツ?陛」ツつ古」ツ?淌ヲツ閉ーテ・ツ?、テ」ツつ津・ツ?コテ・ツ環? for (int i = 0; i < N + 1; i++){ if (max == bucket[i]){ printf("%d\n", i); } } return 0; }
a.cc: In function 'int main()': a.cc:5:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | #define MYSCAN scanf_s | ^~~~~~~ a.cc:19:16: note: in expansion of macro 'MYSCAN' 19 | while (MYSCAN("%d", &input) != EOF){ | ^~~~~~
s980869672
p00028
C++
#include<iostream> #include<string.h> #include<vector> using namespace std; int main() { int a[101]; memset(a,0,sizeof(a)); vector<int>vec; int in; while(cin>>in){ a[in]++; } int m=0; for(int i=0;i<101;i++){ if(a[i]>m){ vec.clear(); vec.push_back(i); } if(a[i]==m){ vec.push_back(i); } } sort(vec.begin(),vec.end()); for(int i=0;i<vec.size();i++){ cout<<vec[i]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'? 24 | sort(vec.begin(),vec.end()); | ^~~~ | short
s194054892
p00028
C++
#include<iostream> using namespace std; int main(){ int numbers[100] , x ,y; y = max(numbers[x]); while ( cin >> x ){ numbers[x - 1]++; } while ( y != 1 ){ cout << numbers[x] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:8: error: no matching function for call to 'max(int&)' 7 | y = max(numbers[x]); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided
s985942329
p00028
C++
#include<iostream> using namespace std; int main(){ int numbers[100] , x ,y, i; while ( cin >> x ){ numbers[x - 1]++; } y = 0; for( i = 0 ; i < 100 ; i++ ){ ??????if (numbers[i] > y){ y = numbers[i]; } } for ( i = 0 ; i < 100 ; i++ ) { if ( y == numbers[i] ){ cout << i + 1 << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:14:1: error: expected primary-expression before '?' token 14 | ??????if (numbers[i] > y){ | ^ a.cc:14:2: error: expected primary-expression before '?' token 14 | ??????if (numbers[i] > y){ | ^ a.cc:14:3: error: expected primary-expression before '?' token 14 | ??????if (numbers[i] > y){ | ^ a.cc:14:4: error: expected primary-expression before '?' token 14 | ??????if (numbers[i] > y){ | ^ a.cc:14:5: error: expected primary-expression before '?' token 14 | ??????if (numbers[i] > y){ | ^ a.cc:14:6: error: expected primary-expression before '?' token 14 | ??????if (numbers[i] > y){ | ^ a.cc:14:7: error: expected primary-expression before 'if' 14 | ??????if (numbers[i] > y){ | ^~ a.cc:14:7: error: expected ':' before 'if' 14 | ??????if (numbers[i] > y){ | ^~ | : a.cc:14:7: error: expected primary-expression before 'if' 14 | ??????if (numbers[i] > y){ | ^~ a.cc:14:7: error: expected ':' before 'if' 14 | ??????if (numbers[i] > y){ | ^~ | : a.cc:14:7: error: expected primary-expression before 'if' 14 | ??????if (numbers[i] > y){ | ^~ a.cc:14:7: error: expected ':' before 'if' 14 | ??????if (numbers[i] > y){ | ^~ | : a.cc:14:7: error: expected primary-expression before 'if' 14 | ??????if (numbers[i] > y){ | ^~ a.cc:14:7: error: expected ':' before 'if' 14 | ??????if (numbers[i] > y){ | ^~ | : a.cc:14:7: error: expected primary-expression before 'if' 14 | ??????if (numbers[i] > y){ | ^~ a.cc:14:7: error: expected ':' before 'if' 14 | ??????if (numbers[i] > y){ | ^~ | : a.cc:14:7: error: expected primary-expression before 'if' 14 | ??????if (numbers[i] > y){ | ^~ a.cc:14:7: error: expected ':' before 'if' 14 | ??????if (numbers[i] > y){ | ^~ | : a.cc:14:7: error: expected primary-expression before 'if' 14 | ??????if (numbers[i] > y){ | ^~
s161310141
p00028
C++
#include <iostream> #include<cmath> using namespace std; void Solution() { int n; int a[101] = {0}; // the array which saves the mode value, at the beginning is all "0" while(cin>>n) { a[n]++; //after input some value, array's value can be added by 1 (0 -> 1), repeat this part. } int times = 0; // save the data in here about most frequently times for(int i = 0; i < 101; i++) // the data is less than 100 { if(a[i] > times) //check the a[] value for ensuring the mode value { times = a[i]; //repeat this part, at the last, can find mode value } } for(int i = 0; i < 101; i++) //output mode value { if(a[i] == times) { cout<<i<<endl; } } } int main() { Solution(); return 0; }
a.cc:10:22: error: extended character   is not valid in an identifier 10 | int a[101] = {0}; // the array which saves the mode value, at the beginning is all "0" | ^ a.cc: In function 'void Solution()': a.cc:10:22: error: '\U00003000' was not declared in this scope 10 | int a[101] = {0}; // the array which saves the mode value, at the beginning is all "0" | ^~
s508301653
p00028
C++
#include <iostream> #include<cmath> using namespace std; void Solution() { int n; int times = 0; // save the data in here about most frequently times int a[101] = {0}; // the array which saves the mode value, at the beginning is all "0" while(cin>>n) { a[n]++; //after input some value, array's value can be added by 1 (0 -> 1), repeat this part. } for(int i = 0; i < 101; i++) // the data is less than 100 { if(a[i] > times) //check the a[] value for ensuring the mode value { times = a[i]; //repeat this part, at the last, can find mode value } } for(int i = 0; i < 101; i++) //output mode value { if(a[i] == times) { cout<<i<<endl; } } } int main() { Solution(); return 0; }
a.cc:12:22: error: extended character   is not valid in an identifier 12 | int a[101] = {0}; // the array which saves the mode value, at the beginning is all "0" | ^ a.cc: In function 'void Solution()': a.cc:12:22: error: '\U00003000' was not declared in this scope 12 | int a[101] = {0}; // the array which saves the mode value, at the beginning is all "0" | ^~
s597590261
p00028
C++
#include <iostream> #include<cmath> using namespace std; void Solution() { int n; int times = 0; // save the data in here about most frequently times int a[101] = {0}; // the array which saves the mode value, at the beginning is all "0" while(cin>>n) { a[n]++; //after input some value, array's value can be added by 1 (0 -> 1), repeat this part. } for(int i = 0; i < 101; i++) // the data is less than 100 { if(a[i] > times) //check the a[] value for ensuring the mode value { times = a[i]; //repeat this part, at the last, can find mode value } } for(int i = 0; i < 101; i++) //output mode value { if(a[i] == times) { cout<<i<<endl; } } return; } int main() { Solution(); return 0; }
a.cc:12:22: error: extended character   is not valid in an identifier 12 | int a[101] = {0}; // the array which saves the mode value, at the beginning is all "0" | ^ a.cc: In function 'void Solution()': a.cc:12:22: error: '\U00003000' was not declared in this scope 12 | int a[101] = {0}; // the array which saves the mode value, at the beginning is all "0" | ^~
s065054073
p00028
C++
#include <iostream> using namespace std; int main() { int d[101]={0}, ????????????a,m=0; while(cin>>a){ d[a]++; m=max(m,d[a]); } for(int i=1;i<=100;i++){ if(m==d[i]) ????????????cout<<i<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:1: error: expected unqualified-id before '?' token 7 | ????????????a,m=0; | ^ a.cc:8:16: error: 'a' was not declared in this scope 8 | while(cin>>a){ | ^ a.cc:10:9: error: 'm' was not declared in this scope 10 | m=max(m,d[a]); | ^ a.cc:13:12: error: 'm' was not declared in this scope 13 | if(m==d[i]) | ^ a.cc:14:1: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:2: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:3: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:4: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:5: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:6: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:7: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:8: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:9: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:10: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:11: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:12: error: expected primary-expression before '?' token 14 | ????????????cout<<i<<endl; | ^ a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token a.cc:14:26: error: expected ':' before ';' token 14 | ????????????cout<<i<<endl; | ^ | : a.cc:14:26: error: expected primary-expression before ';' token
s273872977
p00028
C++
#include <cstdio> #include <vector> using namespace std; int main(){ vector<int> data(101,0); int v; while(scanf("%d",&v)!=-1)data[v]++; int mxvl=0; vector<int> res; for(int i=0;i<=100;++i;){ if(mxvl < data[i]){ mxvl = data[i]; res.clear(); } if(mxvl == data[i])res.push_back(i); } for(int i=0;i<res.size();++i)printf("%d\n",res[i]); return 0; }
a.cc: In function 'int main()': a.cc:12:23: error: expected ')' before ';' token 12 | for(int i=0;i<=100;++i;){ | ~ ^ | ) a.cc:12:24: error: expected primary-expression before ')' token 12 | for(int i=0;i<=100;++i;){ | ^
s084873938
p00028
C++
#include <string> #include <vector> #include <iostream> #include <complex> #include <map> using namespace std; typedef vector<int> VI; #define REP(i,s,t) for(int i=(s);i<(t);i++) int main() { int i; map<int, int> count; while (cin >> i){ map<int, int>::iterator it = count.find(i); if (it!=count.end()){ count[i] += 1; } else { count[i] = 1; } } int mode = 0; VI m; for (auto it = count.cbegin(); it != count.cend(); ++it){ if (mode < it->second){ mode = it->second; m.clear(); m.push_back(it->first); }else if (mode == it->second){ m.push_back(it->first); } } std::sort(m.begin(), m.end()); for (int num:m){ cout << num << endl; } return 0; }
a.cc: In function 'int main()': a.cc:34:10: error: 'sort' is not a member of 'std'; did you mean 'sqrt'? 34 | std::sort(m.begin(), m.end()); | ^~~~ | sqrt
s605533727
p00028
C++
#include <iostream> #include <cmath> #include <vector> using namespace std; #define LENGTH 100 int main(){ vector<int> Digit(LENGTH, 0); int tmp; int cnt=0; while(cin >> tmp){ cnt++; Digit[tmp]++; } int max = 0; vector<int> maxDigits; for(int i=0;i<cnt;i++){ if(Digit[i]>max){ // vector<int>().swap(maxDigits); // maxDigits.clear(); maxDigits.push_back(i); max = Digit[i]; // cout << i << ">:" << endl; }else{ if(Digit[i]==max){ maxDigits.push_back(i); // cout << i << "==:" << endl; } } } sort(maxDigits.begin(), maxDigits.end()); for(int i=0;i<maxDigits.size();i++){ cout << maxDigits[i] << endl; } }
a.cc: In function 'int main()': a.cc:37:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 37 | sort(maxDigits.begin(), maxDigits.end()); | ^~~~ | sqrt
s070309791
p00028
C++
#include <iostream> #include <math.h> using namespace std; int main(){ int a[101] = {0}; int b; int MAX = 0; while(cin >> b){ a[b]++; } for(int j=1; j<101; i++){ MAX = max(MAX, a[j]); } for(int m=1; m<101; m++){ if(MAX == a[m]){ cout << m << endl; } } }
a.cc: In function 'int main()': a.cc:14:29: error: 'i' was not declared in this scope 14 | for(int j=1; j<101; i++){ | ^
s331668330
p00028
C++
#define scanf_s scanf //#define gets_s gets #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 50//00 #define MIN -100001 #define _MAX 100 #define g 9.8 #define d 4.9 int main(void) { int a[_MAX] = { 0 }, x, max = 0; while (scanf_s("%d", &x) != EOF) { ++a[x - 1]; if (a[x - 1] > max) max = a[x - 1]; } for (int i = 0; i < _MAX; ++i) { if (a[i] == max) { printf("%d\n", i + 1); } }s }
a.cc: In function 'int main()': a.cc:24:10: error: 's' was not declared in this scope 24 | }s | ^
s445077891
p00028
C++
#define scanf_s scanf //#define gets_s gets #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 50//00 #define MIN -100001 #define _MAX 100 #define g 9.8 #define d 4.9 int main(void) { int a[_MAX] = { 0 }, x, max = 0; while (scanf_s("%d", &x) != EOF) { ++a[x - 1]; if (a[x - 1] > max) max = a[x - 1]; } for (int i = 0; i < _MAX; ++i) { if (a[i] == max) { printf("%d\n", i + 1); } }s }
a.cc: In function 'int main()': a.cc:24:10: error: 's' was not declared in this scope 24 | }s | ^
s125329705
p00028
C++
#include<iostream> using namespace std; int main(){ int i,a[100]; while(cin >> i) a[i-1]++; int m = max(a[100]); while(int j = 0; j <100; j++){ if(a[j] == m) cout << j + 1 << "\n"; } }
a.cc: In function 'int main()': a.cc:7:14: error: no matching function for call to 'max(int&)' 7 | int m = max(a[100]); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided a.cc:8:18: error: expected ')' before ';' token 8 | while(int j = 0; j <100; j++){ | ~ ^ | ) a.cc:8:20: error: 'j' was not declared in this scope 8 | while(int j = 0; j <100; j++){ | ^
s234091533
p00028
C++
#include<iostream> #include<algorithm> #define N 101 using namespace std; int main(){ int i, m, a[N] = {}; while(cin >> i) a[i]++; for(int j = 1; j < N; j++) m = max(m,a[j]); for(int k = 1; k < N; k++) if(a[k] == max) cout << k << "\n"; }
a.cc: In function 'int main()': a.cc:16:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator==' 16 | if(a[k] == max) | ~~~~~^~~~~~
s504856490
p00028
C++
5 6 3 5 8 7 5 3 9 7 3 4
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 | ^
s114515380
p00028
C++
#include <cstdio> #include <iostream> #include <algorithm> using namespace std; int main() { int a, max1=0,b[101] = {}; while (CI a) { b[a]++; max1 = max(b[a], max1); } for (int i = 0; i < 101; i++) { if (b[i] == max1)CO i EN; } return 0; }
a.cc: In function 'int main()': a.cc:11:16: error: 'CI' was not declared in this scope 11 | while (CI a) { | ^~ a.cc:11:18: error: expected ')' before 'a' 11 | while (CI a) { | ~ ^~ | ) a.cc:11:20: error: expected ';' before ')' token 11 | while (CI a) { | ^ | ; a.cc:17:34: error: 'CO' was not declared in this scope 17 | if (b[i] == max1)CO i EN; | ^~
s694776169
p00028
C++
int main() { int i; int seed,max = 0; int data[100] = { 0 }; int maxnum[100]; while ((scanf("%d", &seed)) != EOF) { data[seed] += 1; } for (i = 0; i < 100; i++) { if (data[i] > max) max = data[i]; } for (i = 0; i < 100; i++) { if (data[i] == max) printf("%d\n", i + 1); } return 0; }
a.cc: In function 'int main()': a.cc:7:17: error: 'scanf' was not declared in this scope 7 | while ((scanf("%d", &seed)) != EOF) | ^~~~~ a.cc:7:40: error: 'EOF' was not declared in this scope 7 | while ((scanf("%d", &seed)) != EOF) | ^~~ a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main() a.cc:17:37: error: 'printf' was not declared in this scope 17 | if (data[i] == max) printf("%d\n", i + 1); | ^~~~~~ a.cc:17:37: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s906536638
p00028
C++
#include <stdio.h> int main() { int i; int seed,max = 0; int data[100] = { 0 }; int maxnum[100]; while ((scanf_s("%d", &seed)) != EOF) { data[seed-1] += 1; } for (i = 0; i < 100; i++) { if (data[i] > max) max = data[i]; } for (i = 0; i < 100; i++) { if (data[i] == max) printf("%d\n", i + 1); } return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | while ((scanf_s("%d", &seed)) != EOF) | ^~~~~~~ | scanf
s888733268
p00028
C++
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <string> #define REP(i, n) for(int i = 0;i < n;i++) #define ll long long #define INF 114514 using namespace std; int main(){ int a[100000] = { 0 }, n, max = 0, f = 0; //vector<int>v(10000); while (cin >> n) { a[n]++; } for (int i = 1; i <= 100; i++) { if (a[n] < max) max = a[n]; } for (int i = 1; i <= 100; i++) { if (a[i] == max) { v[f] = i; f++; } } for (int i = 1; i <= 100; i++) { cout << i << endl; } return 0; }
a.cc: In function 'int main()': a.cc:35:25: error: 'v' was not declared in this scope 35 | v[f] = i; | ^
s165980216
p00028
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int a[10000]={0}; int s,sai,ans=0,c=0; while(cin>>s){ a[s]++; c++; } for(i=0;i<c;i++){ if(a[i]>ans){ ans=a[i]; sai=i; } cout<<sai<<endl<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'i' was not declared in this scope 11 | for(i=0;i<c;i++){ | ^ a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s966946349
p00028
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int a[10000]={0}; int s,sai,ans=0,c=0,i; while(cin>>s){ a[s]++; c++; } for(i=0;i<c;i++){ if(a[i]>ans){ ans=a[i]; sai=i; } cout<<sai<<endl<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s700877941
p00028
C++
#include <iostream> int main(){ int a,c=0,t=0; int b[100],f[100],z[100]; z[0]=0; for(int ds=0;ds<12;ds++){ std::cin>>a; c++; b[c]=a; } for(int g=1;g<=100;g++){ f[g]=0; z[g]=0; } for(int d=1;d<=c;d++){ f[b[d]]++; } for(int g=1;g<=100;g++){ if(f[g]>z[0]){ z[0]=g; t=0; }else if(f[g]==z[0]){a t++; z[t]=g; } } for(int p=0;p<t;p++){ std::cout<<z[p]<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:25:47: error: expected ';' before 't' 25 | }else if(f[g]==z[0]){a | ^ | ; 26 | t++; | ~
s627303112
p00028
C++
#include<iostream> using namespace std; int main(){ int a,n; int my_array[101]={}; while(cin>>a){ my_array[a]++; } int b=0; for(n=1;n<=100;n++){ if(b>my_array[n]) b=my_array[n]; } for(int c=0;c<=100;c++){ if(b==my_array[c]) cout<<c<<endl; }
a.cc: In function 'int main()': a.cc:20:4: error: expected '}' at end of input 20 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s256382501
p00028
C++
#include<iostream> #include<vector> #include <iostream> using namespace std; struct DATA{ int number; int count; }; void PushWordCount(int, vector<DATA>&); bool Compare(const int&, const int&); int main(){ int i, n, max = 0; vector<int> Max; vector<DATA> data; while(cin >> n) PushWordCount(n, data); for(i=0; i<data.size(); ++i){ if(data[i].count == max){ Max.push_back(data[i].number); }else if(data[i].count > max){ Max.clear(); Max.push_back(data[i].number); max = data[i].count; } } sort(Max.begin(), Max.end()); for(i=0; i<Max.size(); ++i) cout << Max[i] << endl; return 0; } void PushWordCount(int n, vector<DATA>& data){ int isFound = 0; DATA newdata; vector<DATA>::iterator iter = data.begin(); while(iter != data.end()){ if(iter->number == n){ isFound = 1; ++iter->count; break; } ++iter; } if(isFound == 0){ newdata.number = n; newdata.count = 1; data.push_back(newdata); } }
a.cc: In function 'int main()': a.cc:32:3: error: 'sort' was not declared in this scope; did you mean 'short'? 32 | sort(Max.begin(), Max.end()); | ^~~~ | short
s955167366
p00028
C++
#include<iostream> using namespace std; int main(){ int n; int nn[100]; int max = 0; for(int i=0;i<100;i++){ nn[i] = 0; } while(cin >> n){ nn[n-1] += 1 if(nn[n-1] > max){ max = nn[n-1]; } } for(int i=0;i<100;i++){ if(nn[i] == max){ cout << i+1 << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:12:21: error: expected ';' before 'if' 12 | nn[n-1] += 1 | ^ | ; 13 | if(nn[n-1] > max){ | ~~
s108379335
p00028
C++
#include <stdio.h> #include<math.h> #include <string.h> #include <ctype.h> int main(){ int i,n; int max,a[100]={0}; while(scanf("%d",&n)!=EOF){ a[n]++; } max=0; for(i=0;i<100;i++){ if(max<a[i]){ max=a[i]; } for(i=0;i<100;i++){ if(a[i]==max){ printf("%d\n",i); } return 0; }
a.cc: In function 'int main()': a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:13:19: note: to match this '{' 13 | for(i=0;i<100;i++){ | ^ a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^