submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s352843833
p00083
C++
#include<stdio.h> void era_transform(int year, int month, int day); int main(void) { int year, month, day; while(scanf("%d %d %d", &year, &month, &day) != EOF) { era_transform(year, month, day); } return 0; } void era_transform(int year, int month, int day) { int date_number = year * 10000 + month * 100 + day; int meiji_number = 1868 * 10000 + 9 * 100 + 8; int taisho_number = 1912 * 10000 + 7 * 100 + 30; int showa_number = 1926 * 10000 + 12 * 100 + 25; int heisei_number = 1989 * 10000 + 1 * 100 + 8; if (date_number < meiji_number) { printf("pre-meiji"); } else if (date_number < taisho_number) { printf("meiji %d %d %d\n", year - 1867, month, day); } else if (date_number < showa_number) { printf("taisho %d %d %d\n", year - 1911, month, day); } else if (date_number < heisei_number) { printf("showa %d %d %d\n", year - 1925, month, day); } else {    printf("heisei %d %d %d\n", year - 1988, month, day); } }
a.cc:30:1: error: extended character   is not valid in an identifier 30 |    printf("heisei %d %d %d\n", year - 1988, month, day); | ^ a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc: In function 'void era_transform(int, int, int)': a.cc:30:1: error: '\U00003000\U00003000\U00003000printf' was not declared in this scope 30 |    printf("heisei %d %d %d\n", year - 1988, month, day); | ^~~~~~~~~~~~
s711397881
p00083
C++
#include<stdio.h> void era_transform(int year, int month, int day); int main(void) { int year, month, day; while(scanf("%d %d %d", &year, &month, &day) != EOF) { era_transform(year, month, day); } return 0; } void era_transform(int year, int month, int day) { int date_number = year * 10000 + month * 100 + day; int meiji_number = 1868 * 10000 + 9 * 100 + 8; int taisho_number = 1912 * 10000 + 7 * 100 + 30; int showa_number = 1926 * 10000 + 12 * 100 + 25; int heisei_number = 1989 * 10000 + 1 * 100 + 8; if (date_number < meiji_number) { printf("pre-meiji\n"); } else if (date_number < taisho_number) { printf("meiji %d %d %d\n", year - 1867, month, day); } else if (date_number < showa_number) { printf("taisho %d %d %d\n", year - 1911, month, day); } else if (date_number < heisei_number) { printf("showa %d %d %d\n", year - 1925, month, day); } else {    printf("heisei %d %d %d\n", year - 1988, month, day); } }
a.cc:30:1: error: extended character   is not valid in an identifier 30 |    printf("heisei %d %d %d\n", year - 1988, month, day); | ^ a.cc:30:1: error: extended character   is not valid in an identifier a.cc:30:1: error: extended character   is not valid in an identifier a.cc: In function 'void era_transform(int, int, int)': a.cc:30:1: error: '\U00003000\U00003000\U00003000printf' was not declared in this scope 30 |    printf("heisei %d %d %d\n", year - 1988, month, day); | ^~~~~~~~~~~~
s917774208
p00083
C++
#include<stdio.h> void era_transform(int year, int month, int day); int main(void) { int year, month, day; while (scanf("%d %d %d", &year, &month, &day) != EOF { era_transform(year, month, day); } return 0; } void era_transform(int year, int month, int day) { int date_number = year * 10000 + month * 100 + day; int meiji_number = 1868 * 10000 + 9 * 100 + 8; int taisho_number = 1912 * 10000 + 7 * 100 + 30; int showa_number = 1926 * 10000 + 12 * 100 + 25; int heisei_number = 1989 * 10000 + 1 * 100 + 8; if (date_number < meiji_number) { printf("pre-meiji\n"); } else if (date_number < taisho_number) { printf("meiji %d %d %d\n", year - 1867, month, day); } else if (date_number < showa_number) { printf("taisho %d %d %d\n", year - 1911, month, day); } else if (date_number < heisei_number) { printf("showa %d %d %d\n", year - 1925, month, day); } else { printf("heisei %d %d %d\n", year - 1988, month, day); } }
a.cc: In function 'int main()': a.cc:8:58: error: expected ')' before '{' token 8 | while (scanf("%d %d %d", &year, &month, &day) != EOF { | ~ ^
s684508443
p00083
C++
#include<stdio.h> void era_transform(int year, int month, int day); int main(void) { int year, month, day; while (scanf("%d %d %d", &year, &month, &day) != EOF { era_transform(year, month, day); } return 0; } void era_transform(int year, int month, int day) { int date_number = year * 10000 + month * 100 + day; int meiji_number = 1868 * 10000 + 9 * 100 + 8; int taisho_number = 1912 * 10000 + 7 * 100 + 30; int showa_number = 1926 * 10000 + 12 * 100 + 25; int heisei_number = 1989 * 10000 + 1 * 100 + 8; if (date_number < meiji_number) { printf("pre-meiji\n"); } else if (date_number < taisho_number) { printf("meiji %d %d %d\n", year - 1867, month, day); } else if (date_number < showa_number) { printf("taisho %d %d %d\n", year - 1911, month, day); } else if (date_number < heisei_number) { printf("showa %d %d %d\n", year - 1925, month, day); } else { printf("heisei %d %d %d\n", year - 1988, month, day); } }
a.cc: In function 'int main()': a.cc:8:58: error: expected ')' before '{' token 8 | while (scanf("%d %d %d", &year, &month, &day) != EOF { | ~ ^
s424899571
p00083
C++
#include<stdio.h> int main(){ int x,y,z; int n1=0,m1=0; while(scanf("%d %d %d"<&x,&y,&z)!=EOF){ n1=10000*x+100y+z; if(n1>=19890108)printf("heisei "); else if(n1>=19261225)printf("showa "); else if(n1>=19120730)printf("taisho "); else if(n1>=18680908)printf("meiji "); else if(n1<18680908)printf("pre-meiji"); if(n1>=18680908)printf("%d %d %d\n",x,y,z); } return 0; }
a.cc: In function 'int main()': a.cc:7:23: error: comparison between distinct pointer types 'const char*' and 'int*' lacks a cast 7 | while(scanf("%d %d %d"<&x,&y,&z)!=EOF){ | ~~~~~~~~~~^~~ a.cc:7:23: error: cannot convert 'bool' to 'const char*' 7 | while(scanf("%d %d %d"<&x,&y,&z)!=EOF){ | ~~~~~~~~~~^~~ | | | bool In file included from a.cc:1: /usr/include/stdio.h:428:42: note: initializing argument 1 of 'int scanf(const char*, ...)' 428 | extern int scanf (const char *__restrict __format, ...) __wur; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ a.cc:8:12: error: unable to find numeric literal operator 'operator""y' 8 | n1=10000*x+100y+z; | ^~~~
s580977798
p00083
C++
#include <stdio.h> int main(void) { int y, m, d; while(1){ scanf("%d %d %d", &y, &m, &d); if((y <= 1868)||(y == 1868 && m <= 9)||(y == 1868 && m == 9 && d < 8){ printf("pre-meiji %d %d %d\n", y+1-1868, m, d); }else if((y <= 1912)||(y == 1912 && m <= 7)||(y == 1912 && m == 7 && d < 30){ printf("meiji %d %d %d\n", y+1-1912, m, d); }else if((y <= 1926)||(y == 1926 && m <= 12)||(y == 1926 && m == 12 && d < 15){ printf("taisho %d %d %d\n", y+1-1926, m, d); }else if((y <= 1989)||(y == 1989 && m <= 1)||(y == 1989 && m == 1 && d < 8){ printf("showa %d %d %d\n", y+1-1989, m, d); }else{ } return 0; }
a.cc: In function 'int main()': a.cc:9:78: error: expected ')' before '{' token 9 | if((y <= 1868)||(y == 1868 && m <= 9)||(y == 1868 && m == 9 && d < 8){ | ~ ^ | ) a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s672716813
p00083
C++
#include <stdio.h> int main(void) { int y, m, d; while(1){ scanf("%d %d %d", &y, &m, &d); if((y <= 1868)||(y == 1868 && m <= 9)||(y == 1868 && m == 9 && d < 8)){ printf("pre-meiji"); }else if((y <= 1912)||(y == 1912 && m <= 7)||(y == 1912 && m == 7 && d < 30){ printf("meiji %d %d %d\n", y+1-1868, m, d); }else if((y <= 1926)||(y == 1926 && m <= 12)||(y == 1926 && m == 12 && d < 15){ printf("taisho %d %d %d\n", y+1-1912, m, d); }else if((y <= 1989)||(y == 1989 && m <= 1)||(y == 1989 && m == 1 && d < 8){ printf("showa %d %d %d\n", y+1-1926, m, d); }else{ printf("heisei %d %d %d\n", y+1-1989, m, d); } } return 0; }
a.cc: In function 'int main()': a.cc:11:85: error: expected ')' before '{' token 11 | }else if((y <= 1912)||(y == 1912 && m <= 7)||(y == 1912 && m == 7 && d < 30){ | ~ ^ | ) a.cc:20:5: error: expected primary-expression before '}' token 20 | } | ^
s542041666
p00083
C++
#include <stdio.h> #include <stdbool.h> int judge(int32_t ye, int32_t mo, int32_t da) { int32_t sum = 10000 * ye + 100 * mo + da; if (sum < 18680908) { printf("pre-meiji\n"); } else if (sum < 19120730) { printf("meiji %d %d %d\n", x - 1867, y, z); } else if (sum < 19261225) { printf("taisho %d %d %d\n", x - 1911, y, z); } else if (sum < 19890108) { printf("showa %d %d %d\n", x - 1925, y, z); } else { printf("heisei %d %d %d\n", x - 1988, y, z); } } void main(void) { int32_t ye, mo, da; while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { judge(ye, mo, da); } }
a.cc:4:11: error: 'int32_t' was not declared in this scope 4 | int judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:3:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 2 | #include <stdbool.h> +++ |+#include <cstdint> 3 | a.cc:4:23: error: 'int32_t' was not declared in this scope 4 | int judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:4:23: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:4:35: error: 'int32_t' was not declared in this scope 4 | int judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:4:35: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:4:45: error: expression list treated as compound expression in initializer [-fpermissive] 4 | int judge(int32_t ye, int32_t mo, int32_t da) | ^ a.cc:21:1: error: '::main' must return 'int' 21 | void main(void) | ^~~~ a.cc: In function 'int main()': a.cc:23:5: error: 'int32_t' was not declared in this scope 23 | int32_t ye, mo, da; | ^~~~~~~ a.cc:23:5: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:24:30: error: 'ye' was not declared in this scope 24 | while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { | ^~ a.cc:24:35: error: 'mo' was not declared in this scope 24 | while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { | ^~ a.cc:24:40: error: 'da' was not declared in this scope 24 | while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { | ^~ a.cc:25:14: error: 'judge' cannot be used as a function 25 | judge(ye, mo, da); | ~~~~~^~~~~~~~~~~~
s476677132
p00083
C++
#include <stdio.h> #include <stdbool.h> int judge(int32_t ye, int32_t mo, int32_t da) { int32_t sum = 10000 * ye + 100 * mo + da; if (sum < 18680908) { printf("pre-meiji\n"); } else if (sum < 19120730) { printf("meiji %d %d %d\n", x - 1867, y, z); } else if (sum < 19261225) { printf("taisho %d %d %d\n", x - 1911, y, z); } else if (sum < 19890108) { printf("showa %d %d %d\n", x - 1925, y, z); } else { printf("heisei %d %d %d\n", x - 1988, y, z); } } void main(void) { int32_t ye, mo, da; while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { scanf ("%d%d%d", &ye, &mo, &da); judge(ye, mo, da); } }
a.cc:4:11: error: 'int32_t' was not declared in this scope 4 | int judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:3:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 2 | #include <stdbool.h> +++ |+#include <cstdint> 3 | a.cc:4:23: error: 'int32_t' was not declared in this scope 4 | int judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:4:23: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:4:35: error: 'int32_t' was not declared in this scope 4 | int judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:4:35: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:4:45: error: expression list treated as compound expression in initializer [-fpermissive] 4 | int judge(int32_t ye, int32_t mo, int32_t da) | ^ a.cc:21:1: error: '::main' must return 'int' 21 | void main(void) | ^~~~ a.cc: In function 'int main()': a.cc:23:5: error: 'int32_t' was not declared in this scope 23 | int32_t ye, mo, da; | ^~~~~~~ a.cc:23:5: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:24:30: error: 'ye' was not declared in this scope 24 | while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { | ^~ a.cc:24:35: error: 'mo' was not declared in this scope 24 | while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { | ^~ a.cc:24:40: error: 'da' was not declared in this scope 24 | while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { | ^~ a.cc:26:14: error: 'judge' cannot be used as a function 26 | judge(ye, mo, da); | ~~~~~^~~~~~~~~~~~
s813886896
p00083
C++
#include <stdio.h> #include <stdbool.h> void judge(int32_t ye, int32_t mo, int32_t da) { int32_t sum = 10000 * ye + 100 * mo + da; if (sum < 18680908) { printf("pre-meiji\n"); } else if (sum < 19120730) { printf("meiji %d %d %d\n", x - 1867, y, z); } else if (sum < 19261225) { printf("taisho %d %d %d\n", x - 1911, y, z); } else if (sum < 19890108) { printf("showa %d %d %d\n", x - 1925, y, z); } else { printf("heisei %d %d %d\n", x - 1988, y, z); } } void main(void) { int32_t ye, mo, da; while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { scanf ("%d%d%d", &ye, &mo, &da); judge(ye, mo, da); } }
a.cc:4:6: error: variable or field 'judge' declared void 4 | void judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~ a.cc:4:12: error: 'int32_t' was not declared in this scope 4 | void judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:3:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 2 | #include <stdbool.h> +++ |+#include <cstdint> 3 | a.cc:4:24: error: 'int32_t' was not declared in this scope 4 | void judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:4:24: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:4:36: error: 'int32_t' was not declared in this scope 4 | void judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:4:36: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:21:1: error: '::main' must return 'int' 21 | void main(void) | ^~~~ a.cc: In function 'int main()': a.cc:23:5: error: 'int32_t' was not declared in this scope 23 | int32_t ye, mo, da; | ^~~~~~~ a.cc:23:5: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:24:30: error: 'ye' was not declared in this scope 24 | while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { | ^~ a.cc:24:35: error: 'mo' was not declared in this scope 24 | while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { | ^~ a.cc:24:40: error: 'da' was not declared in this scope 24 | while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { | ^~ a.cc:26:9: error: 'judge' was not declared in this scope 26 | judge(ye, mo, da); | ^~~~~
s833467474
p00083
C++
#include <stdio.h> #include <stdbool.h> void judge(int32_t ye, int32_t mo, int32_t da) { int32_t sum = 10000 * ye + 100 * mo + da; if (sum < 18680908) { printf("pre-meiji\n"); } else if (sum < 19120730) { printf("meiji %d %d %d\n", x - 1867, y, z); } else if (sum < 19261225) { printf("taisho %d %d %d\n", x - 1911, y, z); } else if (sum < 19890108) { printf("showa %d %d %d\n", x - 1925, y, z); } else { printf("heisei %d %d %d\n", x - 1988, y, z); } } void main(void) { int32_t ye, mo, da; scanf ("%d%d%d", &ye, &mo, &da); while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { judge(ye, mo, da); } }
a.cc:4:6: error: variable or field 'judge' declared void 4 | void judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~ a.cc:4:12: error: 'int32_t' was not declared in this scope 4 | void judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:3:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 2 | #include <stdbool.h> +++ |+#include <cstdint> 3 | a.cc:4:24: error: 'int32_t' was not declared in this scope 4 | void judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:4:24: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:4:36: error: 'int32_t' was not declared in this scope 4 | void judge(int32_t ye, int32_t mo, int32_t da) | ^~~~~~~ a.cc:4:36: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:21:1: error: '::main' must return 'int' 21 | void main(void) | ^~~~ a.cc: In function 'int main()': a.cc:23:5: error: 'int32_t' was not declared in this scope 23 | int32_t ye, mo, da; | ^~~~~~~ a.cc:23:5: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' a.cc:24:23: error: 'ye' was not declared in this scope 24 | scanf ("%d%d%d", &ye, &mo, &da); | ^~ a.cc:24:28: error: 'mo' was not declared in this scope 24 | scanf ("%d%d%d", &ye, &mo, &da); | ^~ a.cc:24:33: error: 'da' was not declared in this scope 24 | scanf ("%d%d%d", &ye, &mo, &da); | ^~ a.cc:26:9: error: 'judge' was not declared in this scope 26 | judge(ye, mo, da); | ^~~~~
s638109811
p00083
C++
#include <stdio.h> #include <stdbool.h> void judge(int ye, int mo, int da) { int sum = 10000 * ye + 100 * mo + da; if (sum < 18680908) { printf("pre-meiji\n"); } else if (sum < 19120730) { printf("meiji %d %d %d\n", x - 1867, y, z); } else if (sum < 19261225) { printf("taisho %d %d %d\n", x - 1911, y, z); } else if (sum < 19890108) { printf("showa %d %d %d\n", x - 1925, y, z); } else { printf("heisei %d %d %d\n", x - 1988, y, z); } } void main(void) { int ye, mo, da; scanf ("%d%d%d", &ye, &mo, &da); while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { judge(ye, mo, da); } }
a.cc: In function 'void judge(int, int, int)': a.cc:10:36: error: 'x' was not declared in this scope 10 | printf("meiji %d %d %d\n", x - 1867, y, z); | ^ a.cc:10:46: error: 'y' was not declared in this scope; did you mean 'ye'? 10 | printf("meiji %d %d %d\n", x - 1867, y, z); | ^ | ye a.cc:10:49: error: 'z' was not declared in this scope 10 | printf("meiji %d %d %d\n", x - 1867, y, z); | ^ a.cc:12:37: error: 'x' was not declared in this scope 12 | printf("taisho %d %d %d\n", x - 1911, y, z); | ^ a.cc:12:47: error: 'y' was not declared in this scope; did you mean 'ye'? 12 | printf("taisho %d %d %d\n", x - 1911, y, z); | ^ | ye a.cc:12:50: error: 'z' was not declared in this scope 12 | printf("taisho %d %d %d\n", x - 1911, y, z); | ^ a.cc:14:36: error: 'x' was not declared in this scope 14 | printf("showa %d %d %d\n", x - 1925, y, z); | ^ a.cc:14:46: error: 'y' was not declared in this scope; did you mean 'ye'? 14 | printf("showa %d %d %d\n", x - 1925, y, z); | ^ | ye a.cc:14:49: error: 'z' was not declared in this scope 14 | printf("showa %d %d %d\n", x - 1925, y, z); | ^ a.cc:16:37: error: 'x' was not declared in this scope 16 | printf("heisei %d %d %d\n", x - 1988, y, z); | ^ a.cc:16:47: error: 'y' was not declared in this scope; did you mean 'ye'? 16 | printf("heisei %d %d %d\n", x - 1988, y, z); | ^ | ye a.cc:16:50: error: 'z' was not declared in this scope 16 | printf("heisei %d %d %d\n", x - 1988, y, z); | ^ a.cc: At global scope: a.cc:21:1: error: '::main' must return 'int' 21 | void main(void) | ^~~~
s518875686
p00083
C++
#include <stdio.h> #include <stdbool.h> void judge(int ye, int mo, int da) { int sum = 10000 * ye + 100 * mo + da; if (sum < 18680908) { printf("pre-meiji\n"); } else if (sum < 19120730) { printf("meiji %d %d %d\n", ye - 1867, mo, da); } else if (sum < 19261225) { printf("taisho %d %d %d\n", ye - 1911, mo, da); } else if (sum < 19890108) { printf("showa %d %d %d\n", ye - 1925, mo, da); } else { printf("heisei %d %d %d\n", ye - 1988, mo, da); } } void main(void) { int ye, mo, da; scanf ("%d%d%d", &ye, &mo, &da); while (scanf ("%d%d%d", &ye, &mo, &da) != EOF) { judge(ye, mo, da); } }
a.cc:21:1: error: '::main' must return 'int' 21 | void main(void) | ^~~~
s693709154
p00083
C++
#include <stdio.h> const int year[4] = {1868, 1912, 1926, 1989}; const int month[4] = {9, 7, 12, 1}; const int day[4] = {8, 30, 25, 8}; const char gengou[5] = {'p', 'm', 't', 's', 'h'};//??????pre-meiji, meiji, taisyou, syowa, heisei??¨?????? char gengouka (int inputyear, int inputmonth, int inputday) { int i; char y;//y????????????????????????????????? for (i = 0; i < 3; ++i) { if (inputyear == year[i]) {//?¢?????????´?????¨???????????? if (inputmonth == month[i]) { if (inputday < day[i]) { y = gengou[i]; break; } else { y = gengou[i + 1]; break; } } else if (inputmonth < month[i]) { y = gengou[i]; break; } else { y = gengou[i + 1]; break; } break; } else if (inputyear < year[i]) { y = gengou[i]; break; } if (inputyear > year[3]) {//???????????????????????§?????? y = gengou[4]; break; } } return y; } int main(void) { int inputyear, inputmonth, inputday, outputyear; ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ char y = gengouka(inputyear, inputmonth, inputday); if (y == 'p') { printf("pre-meiji\n"); } else if (y == 'm') { outputyear = inputyear - year[0] + 1; printf("meiji %d %d %d\n", outputyear, inputmonth, inputday); } else if (y == 't') { outputyear = inputyear - year[1] + 1; printf("taisho %d %d %d\n", outputyear, inputmonth, inputday); } else if (y == 's') { outputyear = inputyear - year[2] + 1; printf("syowa %d %d %d\n", outputyear, inputmonth, inputday); } else { outputyear = inputyear - year[3] + 1; printf("heisei %d %d %d\n", outputyear, inputmonth, inputday); } } return 0; }
a.cc: In function 'int main()': a.cc:46:1: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:2: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:3: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:4: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:5: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:6: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:7: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:8: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:9: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:10: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:11: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:12: error: expected primary-expression before '?' token 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^ a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while(scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF){ | ^~~~~
s032767429
p00083
C++
#include <stdio.h> const int year[4] = {1868, 1912, 1926, 1989}; const int month[4] = {9, 7, 12, 1}; const int day[4] = {8, 30, 25, 8}; const char gengou[5] = {'p', 'm', 't', 's', 'h'};//??????pre-meiji, meiji, taisyou, syowa, heisei??¨?????? char gengouka (int inputyear, int inputmonth, int inputday) { int i; char y;//y????????????????????????????????? for (i = 0; i < 3; ++i) { if (inputyear == year[i]) {//?¢?????????´?????¨???????????? if (inputmonth == month[i]) { if (inputday < day[i]) { y = gengou[i]; break; } else { y = gengou[i + 1]; break; } } else if (inputmonth < month[i]) { y = gengou[i]; break; } else { y = gengou[i + 1]; break; } break; } else if (inputyear < year[i]) { y = gengou[i]; break; } if (inputyear > year[3]) {//???????????????????????§?????? y = gengou[4]; break; } } return y; } int main(void) { int inputyear, inputmonth, inputday, outputyear; ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { char y = gengouka(inputyear, inputmonth, inputday); if (y == 'p') { printf("pre-meiji\n"); } else if (y == 'm') { outputyear = inputyear - year[0] + 1; printf("meiji %d %d %d\n", outputyear, inputmonth, inputday); } else if (y == 't') { outputyear = inputyear - year[1] + 1; printf("taisho %d %d %d\n", outputyear, inputmonth, inputday); } else if (y == 's') { outputyear = inputyear - year[2] + 1; printf("syowa %d %d %d\n", outputyear, inputmonth, inputday); } else { outputyear = inputyear - year[3] + 1; printf("heisei %d %d %d\n", outputyear, inputmonth, inputday); } } return 0; }
a.cc: In function 'int main()': a.cc:46:1: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:2: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:3: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:4: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:5: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:6: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:7: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:8: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:9: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:10: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:11: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:12: error: expected primary-expression before '?' token 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^ a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ a.cc:46:13: error: expected ':' before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~ | : a.cc:46:13: error: expected primary-expression before 'while' 46 | ????????????while (scanf("%d %d %d", &inputyear, &inputmonth, &inputday) != EOF) { | ^~~~~
s961769756
p00083
C++
#include <stdio.h> int32_t year, month, day, sum; int print(void); int main(void) { while(scanf("%d %d %d", &year, &month, &day) != EOF) { sum = 10000 * year+ 100 * month + day; print(); } return 0; } int print(void) { if (sum < 18680907) { printf("pre-meiji\n"); } else if (sum < 19120730) { printf("meiji %d %d %d\n", year - 1867, month, day); } else if (sum < 19261225) { printf("taisho %d %d %d\n", year - 1911, month, day); } else if (sum < 19890108) { printf("showa %d %d %d\n", year - 1925, month, day); } else { printf("heisei %d %d %d\n", year - 1988, month, day); } }
a.cc:3:1: error: 'int32_t' does not name a type 3 | int32_t year, month, day, sum; | ^~~~~~~ a.cc:2:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 1 | #include <stdio.h> +++ |+#include <cstdint> 2 | a.cc: In function 'int main()': a.cc:9:30: error: 'year' was not declared in this scope 9 | while(scanf("%d %d %d", &year, &month, &day) != EOF) { | ^~~~ a.cc:9:37: error: 'month' was not declared in this scope 9 | while(scanf("%d %d %d", &year, &month, &day) != EOF) { | ^~~~~ a.cc:9:45: error: 'day' was not declared in this scope 9 | while(scanf("%d %d %d", &year, &month, &day) != EOF) { | ^~~ a.cc:10:5: error: 'sum' was not declared in this scope 10 | sum = 10000 * year+ 100 * month + day; | ^~~ a.cc: In function 'int print()': a.cc:18:9: error: 'sum' was not declared in this scope 18 | if (sum < 18680907) { | ^~~ a.cc:21:36: error: 'year' was not declared in this scope 21 | printf("meiji %d %d %d\n", year - 1867, month, day); | ^~~~ a.cc:21:49: error: 'month' was not declared in this scope 21 | printf("meiji %d %d %d\n", year - 1867, month, day); | ^~~~~ a.cc:21:56: error: 'day' was not declared in this scope 21 | printf("meiji %d %d %d\n", year - 1867, month, day); | ^~~ a.cc:23:37: error: 'year' was not declared in this scope 23 | printf("taisho %d %d %d\n", year - 1911, month, day); | ^~~~ a.cc:23:50: error: 'month' was not declared in this scope 23 | printf("taisho %d %d %d\n", year - 1911, month, day); | ^~~~~ a.cc:23:57: error: 'day' was not declared in this scope 23 | printf("taisho %d %d %d\n", year - 1911, month, day); | ^~~ a.cc:25:36: error: 'year' was not declared in this scope 25 | printf("showa %d %d %d\n", year - 1925, month, day); | ^~~~ a.cc:25:49: error: 'month' was not declared in this scope 25 | printf("showa %d %d %d\n", year - 1925, month, day); | ^~~~~ a.cc:25:56: error: 'day' was not declared in this scope 25 | printf("showa %d %d %d\n", year - 1925, month, day); | ^~~ a.cc:27:37: error: 'year' was not declared in this scope 27 | printf("heisei %d %d %d\n", year - 1988, month, day); | ^~~~ a.cc:27:50: error: 'month' was not declared in this scope 27 | printf("heisei %d %d %d\n", year - 1988, month, day); | ^~~~~ a.cc:27:57: error: 'day' was not declared in this scope 27 | printf("heisei %d %d %d\n", year - 1988, month, day); | ^~~ a.cc:29:1: warning: no return statement in function returning non-void [-Wreturn-type] 29 | } | ^
s117390495
p00083
C++
#include <stdio.h> int Y, M, D; bool is_leap(int y) { return i % 400 == 0 || (i % 4 == 0 && i % 100 != 0); } int count(int y, int m, int d) { int ret = 0; for(int i = 1; i < y; i++) { if(is_leap(i)) ret += 366; else ret += 365; } for(int i = 1; i < m; i++) { if(i == 2) ret += (is_leap(y) ? 29 : 28); else if(i == 4 || i == 6 || i == 9 || i == 11) ret += 30; else ret += 31; } return ret + d; } int main() { while(~scanf("%d%d%d", &Y, &M, &D)) { if(count(Y, M, D) >= count(1989, 1, 8)) printf("heisei %d %d %d\n", Y - 1988, M, D); if(count(Y, M, D) >= count(1926, 12, 25)) printf("heisei %d %d %d\n", Y - 1925, M, D); if(count(Y, M, D) >= count(1912, 7, 30)) printf("heisei %d %d %d\n", Y - 1911, M, D); if(count(Y, M, D) >= count(1868, 9, 8)) printf("heisei %d %d %d\n", Y - 1867, M, D); else printf("pre-meiji\n"); } }
a.cc: In function 'bool is_leap(int)': a.cc:4:16: error: 'i' was not declared in this scope 4 | return i % 400 == 0 || (i % 4 == 0 && i % 100 != 0); | ^
s966685601
p00083
C++
<?php while(fscanf(STDIN, "%d%d%d", $a, $b, $c)){ if(($a >= 1989 && $b >= 1 && $c >= 8) || ($a >= 1989 && $b >= 2) || ($a >= 1990)) { $a -= 1988; print("heisei $a $b $c\n"); } else{ if(($a >= 1926 && $b >= 12 && $c >= 25) || ($a >= 1927)){ $a -= 1925; print("showa $a $b $c\n"); } else{ if(($a >= 1912 && $b >= 7 && $c >= 30) || ($a >= 1912 && $b >= 8) || ($a >= 1913)){ $a -= 1911; print("taisho $a $b $c\n"); } else{ if(($a >= 1868 && $b >= 9 && $c >= 8) || ($a >= 1868 && $b >= 10) || ($a >= 1869)){ $a -= 1867; print("meiji $a $b $c\n"); } else{ print("pre-meiji\n"); } } } } } ?>
a.cc:1:1: error: expected unqualified-id before '<' token 1 | <?php | ^ a.cc:34:17: error: expected unqualified-id before '?' token 34 | ?> | ^
s155798758
p00083
C++
<?php while(fscanf(STDIN, "%d%d%d", $a, $b, $c)){ if(($a >= 1989 && $b >= 1 && $c >= 8) || ($a >= 1989 && $b >= 2) || ($a >= 1990)) { $a -= 1988; print("heisei $a $b $c\n"); } else{ if(($a >= 1926 && $b >= 12 && $c >= 25) || ($a >= 1927)){ $a -= 1925; print("showa $a $b $c\n"); } else{ if(($a >= 1912 && $b >= 7 && $c >= 30) || ($a >= 1912 && $b >= 8) || ($a >= 1913)){ $a -= 1911; print("taisho $a $b $c\n"); } else{ if(($a >= 1868 && $b >= 9 && $c >= 8) || ($a >= 1868 && $b >= 10) || ($a >= 1869)){ $a -= 1867; print("meiji $a $b $c\n"); } else{ print("pre-meiji\n"); } } } } } ?>
a.cc:1:9: error: expected unqualified-id before '<' token 1 | <?php | ^ a.cc:34:17: error: expected unqualified-id before '?' token 34 | ?> | ^
s739708305
p00083
C++
int y,m,d,now; while(cin>>y>>m>>d) { now = y*10000+m*100+d; if(now<m_lb){cout << "pre-meiji"<<endl;continue;} if(now<t_lb){cout << "meiji "<<y-1867 << " " <<m<<" "<< d<<endl; continue;} if(now<s_lb){cout << "taisho "<<y-1911 << " " <<m<<" "<< d<<endl; continue;} if(now<h_lb){cout << "showa "<<y-1925 << " " <<m<<" "<< d<<endl; continue;} cout << "heisei "<<y-1988 << " " <<m<<" "<< d<<endl; continue; } return 0; }
a.cc:2:5: error: expected unqualified-id before 'while' 2 | while(cin>>y>>m>>d) | ^~~~~ a.cc:13:5: error: expected unqualified-id before 'return' 13 | return 0; | ^~~~~~ a.cc:14:1: error: expected declaration before '}' token 14 | } | ^
s792782974
p00083
C++
g#include <iostream> #include <string> using namespace std; struct Date { int year, month, day; Date(int year=0, int month=1, int day=1) : year(year), month(month), day(day) {} bool operator<(const Date &o) const { if (year == o.year) { if (month == o.month) { return day < o.day; } return month < o.month; } return year < o.year; } }; int main() { int year, month, day; Date meiji_start(1868, 9, 8), meiji_end(1912, 7, 29), taisho_start(1912, 7, 30), taisho_end(1926, 12, 24), showa_start(1926, 12, 25), showa_end(1989, 1, 7), heisei_start(1989, 1, 8); while (cin >> year >> month >> day) { Date date(year, month, day); if (date < meiji_start) { cout << "pre-meiji" << endl; } else if (date < taisho_start) { cout << "meiji " << date.year - meiji_start.year + 1 << ' ' << date.month << ' ' << date.day << endl; } else if (date < showa_start) { cout << "taisho " << date.year - taisho_start.year + 1 << ' ' << date.month << ' ' << date.day << endl; } else if (date < heisei_start) { cout << "showa " << date.year - showa_start.year + 1 << ' ' << date.month << ' ' << date.day << endl; } else { cout << "heisei " << date.year - heisei_start.year + 1 << ' ' << date.month << ' ' << date.day << endl; } } return 0; }
a.cc:1:2: error: stray '#' in program 1 | g#include <iostream> | ^ a.cc:1:1: error: 'g' does not name a type 1 | g#include <iostream> | ^ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~ | __n /usr/include/c++/14/bits/char_traits.h: At global scope: /usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a
s989860067
p00084
Java
public class Main{ Scanner sc = new Scanner(System.in); public static void main(String[] args) { new Main(); } public Main() { new Base().doIt(); } class Base{ String[] STR(String a){ String[] sp1 = a.split("[, .]"); return sp1; } /* class Data{ int x; double y; public Data(int n,double m) { this.x = n; this.y = m; } } */ void doIt(){ //整数入力 String n = sc.next(); //少数入力 double m = sc.nextDouble(); System.out.println(STR(n)); // } } }
Main.java:2: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:2: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s291542337
p00084
Java
import java.util.*; public class Main{ Scanner in = new Scanner(System.in); void solve(){ List<String> list = Arrays.asList(in.nextLine().replaceAll(",|\\."," ").split("[ ]+")); System.out.println(String.join(" ", list.stream().filter(s -> 2 < s.length() && s.length() < 7).collect(Collectors.toList()))); } public static void main(String[] args){ new Main().solve(); } }
Main.java:8: error: cannot find symbol System.out.println(String.join(" ", list.stream().filter(s -> 2 < s.length() && s.length() < 7).collect(Collectors.toList()))); ^ symbol: variable Collectors location: class Main 1 error
s225641991
p00084
Java
import java.util.Scanner; public static void main(String[] args) { try(Scanner sc = new Scanner(System.in)) { while(sc.hasNextLine()){ String line=sc.nextLine(); String[] tokens = line.split(“[,. ]“); ArrayList<String> list = new ArrayList<>(); for(String t: tokens) { if(t.length() >= 3 && t.length() <= 6) { list.add(t); } } System.out.println(String.join(” “, list.toArray(new String[0]))); } } }
Main.java:6: error: illegal character: '\u201c' String[] tokens = line.split(?[,. ]?); ^ Main.java:6: error: illegal character: '\u201c' String[] tokens = line.split(?[,. ]?); ^ Main.java:13: error: illegal character: '\u201d' System.out.println(String.join(? ?, list.toArray(new String[0]))); ^ Main.java:13: error: illegal character: '\u201c' System.out.println(String.join(? ?, list.toArray(new String[0]))); ^ Main.java:2: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) Main.java:13: error: ';' expected System.out.println(String.join(? ?, list.toArray(new String[0]))); ^ 6 errors
s281056602
p00084
Java
mport java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] ary = sc.nextLine().split("[ ,\\.]"); int i =0; for(String o : ary) { if(i==0) i=1; else System.out.print(" "); System.out.print(o); } System.out.println(); } }
Main.java:1: error: class, interface, enum, or record expected mport java.util.*; ^ 1 error
s268006850
p00084
Java
mport java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] ary = sc.nextLine().split("[ ,\\.]"); int i=0,j; for(String o : ary) { j=o.length(); if(j>2&&j<7){ if(i==0) i=1; else System.out.print(" "); System.out.print(o); } } System.out.println(); } }
Main.java:1: error: class, interface, enum, or record expected mport java.util.*; ^ 1 error
s766095971
p00084
Java
mport java.io.*; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String tmp = br.readLine(); int cnt = 0; String[] ans = new String[1024]; char[] s = tmp.toCharArray(); for(int i=0;i<s.length;i++){ if(s[i] == ',' || s[i] == '.') s[i]= ' '; } tmp = String.valueOf(s); String[] data = tmp.split(" "); for(int i=0;i<data.length;i++){ if(data[i].length() > 2 && data[i].length() < 7) { ans[cnt] = data[i]; cnt++; } } for(int i=0;i<cnt;i++){ if(i == cnt-1) System.out.println(ans[i]); else System.out.print(ans[i] + " "); } } }
Main.java:1: error: class, interface, enum, or record expected mport java.io.*; ^ 1 error
s544432608
p00084
C
import java.util.Scanner; public class J0084{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ String word = sc.next(); int n = word.length(); //System.out.println("n=" + n); if(word.charAt(n-1) == ',' || word.charAt(n-1) == '.') { n--; } if(n>=3 && n<=6) { System.out.print(word.substring(0,n) + " "); } } System.out.println(); } }
main.c:1:1: error: unknown type name 'import' 1 | import java.util.Scanner; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.util.Scanner; | ^ main.c:3:1: error: unknown type name 'public' 3 | public class J0084{ | ^~~~~~ main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'J0084' 3 | public class J0084{ | ^~~~~
s904304798
p00084
C
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ String word = sc.next(); int n = word.length(); //System.out.println("n=" + n); if(word.charAt(n-1) == ',' || word.charAt(n-1) == '.') { n--; } if(n>=3 && n<=6) { System.out.print(word.substring(0,n) + " "); } } System.out.println(); } }
main.c:1:1: error: unknown type name 'import' 1 | import java.util.Scanner; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.util.Scanner; | ^ main.c:3:1: error: unknown type name 'public' 3 | public class Main{ | ^~~~~~ main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main' 3 | public class Main{ | ^~~~
s014308920
p00084
C
include<stdio.h> #include<string.h> void aaa(int m,int i,char *a){ int g; if(3<=m&&6>=m){ for(g=i-m;g<i;g++) printf("%c",a[g]); putchar(' '); } } int main(){ char a[2000]; int h,i,m=0; gets(a); h=strlen(a); for(i=0;i<h;i++){ if(a[i]=='.'||a[i]==','||a[i]==' '){ if(m>0){ aaa(m,i,a); m=0; } } else m++; } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 33 | #include <stddef.h> +++ |+#include <stddef.h> 34 | /usr/include/string.h:47:56: error: unknown type name 'size_t' 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:55:32: error: unknown type name 'size_t' 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:61:42: error: unknown type name 'size_t' 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:64:56: error: unknown type name 'size_t' 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:80:60: error: unknown type name 'size_t' 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:107:48: error: unknown type name 'size_t' 107 | extern void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:145:53: error: unknown type name 'size_t' 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:153:23: error: unknown type name 'size_t' 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:159:57: error: unknown type name 'size_t' 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:166:8: error: unknown type name 'size_t' 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:167:54: error: unknown type name 'size_t' 167 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:8: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:59: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:195:45: error: unknown type name 'size_t' 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:293:8: error: unknown type name 'size_t' 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:297:8: error: unknown type name 'size_t' 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:389:46: error: unknown type name 'size_t' 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:390:44: error: unknown type name 'size_t' 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:398:55: error: unknown type name 'size_t' 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:401:53: error: unknown type name 'size_t' 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:407:8: error: unknown type name 'size_t' 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:8: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:46: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26: /usr/include/string.h:432:12: error: unknown type name 'size_t' 432 | extern int __REDIRECT_NTH (strerror_r, | ^~~~~~~~~~~~~~ /usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: unknown type name 'size_t' 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 23 | #include <stddef.h> +++ |+#include <stddef.h> 24 | /usr/include/strings.h:38:53: error: unknown type name 'size_t' 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:42:31: error: unknown type name 'size_t' 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:120:61: error: unknown type name 'size_t' 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:134:27: error: unknown type name 'size_t' 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/strings.h:134:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:466:40: error: unknown type name
s551447448
p00084
C
#include<stdio.h> #include<string.h> void aaa(int m,int i,char *a){ int g; if(3<=m&&6>=m){ for(g=i-m;g<i;g++) printf("%c",a[g]); putchar(' '); } } int main(){ char a[2000]; int h,i,m=0; gets(a); h=strlen(a); for(i=0;i<h;i++){ if(a[i]=='.'||a[i]==','||a[i]==' '){ if(m>0){ aaa(m,i,a); m=0; } } else m++; } return 0; }
main.c: In function 'main': main.c:14:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 14 | gets(a); | ^~~~ | fgets
s024454639
p00084
C
include<stdio.h> #include<string.h> int main(){ char str[1100]; int l,i,j,k,flg; fgets(str,1050,stdin); l=strlen(str); str[l-1]=' '; flg=0; for(i=0;;i++){ loop: if(i>=l-1)break; for(j=i;j<l;j++){ if(str[j]==' '||str[j]=='.'||str[j]==','){ if(j-i>=2&&j-i<=5){ if(flg==1)printf(" "); flg=1; for(k=i-1;k<j;k++){ printf("%c",str[k]); } } for(;str[j]==' '||str[j]=='.'||str[j]=='.';j++); i=j+1; goto loop; } } } printf("\n"); return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 33 | #include <stddef.h> +++ |+#include <stddef.h> 34 | /usr/include/string.h:47:56: error: unknown type name 'size_t' 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:55:32: error: unknown type name 'size_t' 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:61:42: error: unknown type name 'size_t' 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:64:56: error: unknown type name 'size_t' 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:80:60: error: unknown type name 'size_t' 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:107:48: error: unknown type name 'size_t' 107 | extern void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:145:53: error: unknown type name 'size_t' 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:153:23: error: unknown type name 'size_t' 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:159:57: error: unknown type name 'size_t' 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:166:8: error: unknown type name 'size_t' 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:167:54: error: unknown type name 'size_t' 167 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:8: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:59: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:195:45: error: unknown type name 'size_t' 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:293:8: error: unknown type name 'size_t' 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:297:8: error: unknown type name 'size_t' 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:389:46: error: unknown type name 'size_t' 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:390:44: error: unknown type name 'size_t' 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:398:55: error: unknown type name 'size_t' 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:401:53: error: unknown type name 'size_t' 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:407:8: error: unknown type name 'size_t' 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:8: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:46: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26: /usr/include/string.h:432:12: error: unknown type name 'size_t' 432 | extern int __REDIRECT_NTH (strerror_r, | ^~~~~~~~~~~~~~ /usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: unknown type name 'size_t' 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 23 | #include <stddef.h> +++ |+#include <stddef.h> 24 | /usr/include/strings.h:38:53: error: unknown type name 'size_t' 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:42:31: error: unknown type name 'size_t' 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:120:61: error: unknown type name 'size_t' 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:134:27: error: unknown type name 'size_t' 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/strings.h:134:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:466:40: error: unknown type name
s563324783
p00084
C
#include <stdio.h> #include <string.h> #include <conio.h> int getNextWord(int added, char* src, char* word) { int i; for( i = 0; src[i] != ' ' && src[i] != '.' && src[i] != ',' && src[i] != '\0'; i++ ) { word[i] = src[i]; } word[i] = '\0'; for(; src[i] == ' ' || src[i] == '.' || src[i] == ',' || src[i] == '\0'; i++ ) { } return (i + added); } int main(void) { char string[2048] = {0}; char word[2048] = {0}; int i; int len; fgets( string, 2048, stdin ); string[ strlen( string ) ] = '\0'; for( i = 0; i < 2048; ) { i = getNextWord( i, string + i, word ); len = strlen( word ); if( len >= 3 && len <= 6 ) { printf("%s ", word); } } puts(""); return (0); }
main.c:3:10: fatal error: conio.h: No such file or directory 3 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s607702003
p00084
C++
#include<stdio.h> #include<iostream> #include<string> using namespace std; int main(){ string st; bool f=false; while(cin>>st){ int t=st.size(); if(t<=6&&t>=3){ if(f==true)cout<<" "; cout<<st;f=false; } 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(){ | ^
s997842212
p00084
C++
import java.io.*; class Main { public static void main(String args[]) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { String buf = br.readLine(); boolean First = true; for (int i=0;i<buf.length();i++) { String str = ""; while (NotStop(buf.charAt(i))) { str = str+buf.charAt(i); i++; } if (str.length()>=3&&str.length()<=6) { if (First) { System.out.print(str); First = false; } else System.out.print(" "+str); } } System.out.println(""); } catch (Exception e) { e.printStackTrace(); } } public static boolean NotStop(char a) { if (a=='.'||a==' '||a==',') return false; else return true; } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:15: error: expected ':' before 'static' 4 | public static void main(String args[]) { | ^~~~~~~ | : a.cc:4:33: error: 'String' has not been declared 4 | public static void main(String args[]) { | ^~~~~~ a.cc:30:15: error: expected ':' before 'static' 30 | public static boolean NotStop(char a) { | ^~~~~~~ | : a.cc:30:23: error: 'boolean' does not name a type; did you mean 'bool'? 30 | public static boolean NotStop(char a) { | ^~~~~~~ | bool a.cc:34:2: error: expected ';' after class definition 34 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:5:17: error: 'BufferedReader' was not declared in this scope 5 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); | ^~~~~~~~~~~~~~ a.cc:8:25: error: 'String' was not declared in this scope 8 | String buf = br.readLine(); | ^~~~~~ a.cc:9:25: error: 'boolean' was not declared in this scope; did you mean 'bool'? 9 | boolean First = true; | ^~~~~~~ | bool a.cc:10:40: error: 'buf' was not declared in this scope 10 | for (int i=0;i<buf.length();i++) { | ^~~ a.cc:11:40: error: expected ';' before 'str' 11 | String str = ""; | ^~~ a.cc:12:40: error: 'NotStop' was not declared in this scope 12 | while (NotStop(buf.charAt(i))) { | ^~~~~~~ a.cc:13:41: error: 'str' was not declared in this scope; did you mean 'std'? 13 | str = str+buf.charAt(i); | ^~~ | std a.cc:16:37: error: 'str' was not declared in this scope; did you mean 'std'? 16 | if (str.length()>=3&&str.length()<=6) { | ^~~ | std a.cc:17:45: error: 'First' was not declared in this scope 17 | if (First) { | ^~~~~ a.cc:18:49: error: 'System' was not declared in this scope 18 | System.out.print(str); | ^~~~~~ a.cc:21:46: error: 'System' was not declared in this scope 21 | else System.out.print(" "+str); | ^~~~~~ a.cc:24:25: error: 'System' was not declared in this scope 24 | System.out.println(""); | ^~~~~~ a.cc:25:26: error: 'Exception' does not name a type 25 | } catch (Exception e) { | ^~~~~~~~~ a.cc:26:25: error: 'e' was not declared in this scope 26 | e.printStackTrace(); | ^
s212818977
p00084
C++
import sys line = raw_input() word_list = line.translate(None, '.,').split() ans = [] for word in word_list: if len(word) >= 3 and len(word) <= 6: ans.append(word) for i, w in enumerate(ans): if i != 0: sys.stdout.write(" ") sys.stdout.write(w) sys.stdout.write("\n")
a.cc:4:34: warning: multi-character character constant [-Wmultichar] 4 | word_list = line.translate(None, '.,').split() | ^~~~ a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s049680149
p00084
C++
#include<bits/stdc++.h> #define rep(i,n)for(ll i=0;i<n;i++) using namespace std; typedef long long ll; char s[2000]; vector<string>ans; int main() { gets_s(s); char*split; split = strtok(s, " ,."); do { if (3 <= strlen(split) && strlen(split) <= 6) ans.push_back(string(split)); } while (split = strtok(NULL, " ,."), split); rep(i, ans.size()) { cout << ans[i] << (i == ans.size() - 1 ? '\n' : ' '); } return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'gets_s' was not declared in this scope; did you mean 'getsid'? 10 | gets_s(s); | ^~~~~~ | getsid
s187698753
p00084
C++
#include <iostream> #include <vector> #include <string> #include <sstream> using namespace std; vector<string> split(const string& input, char delimiter) { istringstream stream(input); string field; vector<string> result; while (getline(stream, field, delimiter)) { result.push_back(field); } return result; } int main() { string str; int i = 0; getline(cin, str); replace(str.begin(), str.end(), '.', ' '); replace(str.begin(), str.end(), ',', ' '); for (const string& s : split(str, ' ')) { int size = str.size(); if(size > 2 && size < 7) { cout << s << ' ' << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:24:3: error: 'replace' was not declared in this scope 24 | replace(str.begin(), str.end(), '.', ' '); | ^~~~~~~
s199313359
p00084
C++
#include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> using namespace std; vector<string> split(const string& input, char delimiter) { istringstream stream(input); string field; vector<string> result; while (getline(stream, field, delimiter)) { result.push_back(field); } return result; } int main() { string str; int i = 0; getline(cin, str); replace(str.begin(), str.end(), '.' | ',', ' '); //replace(str.begin(), str.end(), ',', ' '); for (const string& s : split(str, ' ')) { int size = s.size(); if(size > 2 && size < 7) { cout << s << ' '; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:25:10: error: no matching function for call to 'replace(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, int, char)' 25 | replace(str.begin(), str.end(), '.' | ',', ' '); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:5: /usr/include/c++/14/bits/stl_algo.h:4280:5: note: candidate: 'template<class _FIter, class _Tp> void std::replace(_FIter, _FIter, const _Tp&, const _Tp&)' 4280 | replace(_ForwardIterator __first, _ForwardIterator __last, | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4280:5: note: template argument deduction/substitution failed: a.cc:25:10: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'char') 25 | replace(str.begin(), str.end(), '.' | ',', ' '); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:174:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::replace(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&, const _Tp&)' 174 | replace(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:174:1: note: candidate expects 5 arguments, 4 provided
s374898284
p00084
C++
#include <vector> #include <string> #include <sstream> #include <algorithm> using namespace std; /* vector<string> split(const string& input, char delimiter) { istringstream stream(input); string field; vector<string> result; while (getline(stream, field, delimiter)) { result.push_back(field); } return result; } */ int main() { string str, word; int i = 0; getline(cin, str); while(str[i] != '\0'){ if(str[i] == '.' || str[i] == ',') str[i] = ' '; i++; } /* for (const string& s : split(str, ' ')) { int size = s.size(); if(size > 2 && size < 7) { cout << s << ' '; } } */ stringstream ss(str); while (ss >> word) { int len = word.length(); if(len>=3&&len<=6){ if(i==0){cout<<word;i++;} else cout<<' '<<word; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:11: error: 'cin' was not declared in this scope 23 | getline(cin, str); | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include <algorithm> +++ |+#include <iostream> 5 | using namespace std; a.cc:44:18: error: 'cout' was not declared in this scope 44 | if(i==0){cout<<word;i++;} | ^~~~ a.cc:44:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:45:17: error: 'cout' was not declared in this scope 45 | else cout<<' '<<word; | ^~~~ a.cc:45:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:49:3: error: 'cout' was not declared in this scope 49 | cout << endl; | ^~~~ a.cc:49:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s596186299
p00084
C++
#include <vector> #include <string> #include <sstream> #include <algorithm> using namespace std; /* vector<string> split(const string& input, char delimiter) { istringstream stream(input); string field; vector<string> result; while (getline(stream, field, delimiter)) { result.push_back(field); } return result; } */ int main() { string str, word; int i = 0; getline(cin, str); while(str[i] != '\0'){ if(str[i] == '.' || str[i] == ',') str[i] = ' '; i++; } /* for (const string& s : split(str, ' ')) { int size = s.size(); if(size > 2 && size < 7) { cout << s << ' '; } } */ stringstream ss(str); while (ss >> word) { int len = word.length(); if(len>=3&&len<=6){ if(i==0){cout<<word;i++;} else cout<<' '<<word; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:11: error: 'cin' was not declared in this scope 23 | getline(cin, str); | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include <algorithm> +++ |+#include <iostream> 5 | using namespace std; a.cc:44:18: error: 'cout' was not declared in this scope 44 | if(i==0){cout<<word;i++;} | ^~~~ a.cc:44:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:45:17: error: 'cout' was not declared in this scope 45 | else cout<<' '<<word; | ^~~~ a.cc:45:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:49:3: error: 'cout' was not declared in this scope 49 | cout << endl; | ^~~~ a.cc:49:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s647184366
p00084
C++
#include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> using namespace std; /* vector<string> split(const string& input, char delimiter) { istringstream stream(input); string field; vector<string> result; while (getline(stream, field, delimiter)) { result.push_back(field); } return result; } */ int main() { string str, word; int i = 0; getline(cin, str); while(str[i] != '\0'){ if(str[i] == '.' || str[i] == ',') str[i] = ' '; i++; } /* for (const string& s : split(str, ' ')) { int size = s.size(); if(size > 2 && size < 7) { cout << s << ' '; } } */ stringstream ss(str); i=0 while (ss >> word) { int len = word.length(); if(len>=3&&len<=6){ if(i==0){cout<<word;i++;} else cout<<' '<<word; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:42:6: error: expected ';' before 'while' 42 | i=0 | ^ | ; 43 | while (ss >> word) { | ~~~~~
s559877116
p00084
C++
#include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> using namespace std; /* vector<string> split(const string& input, char delimiter) { istringstream stream(input); string field; vector<string> result; while (getline(stream, field, delimiter)) { result.push_back(field); } return result; } */ int main() { string str, word; int i = 0; getline(cin, str); while(str[i] != '\0'){ if(str[i] == '.' || str[i] == ',') str[i] = ' '; i++; } /* for (const string& s : split(str, ' ')) { int size = s.size(); if(size > 2 && size < 7) { cout << s << ' '; } } */ stringstream ss(str); i=0 while (ss >> word) { int len = word.length(); if(len>=3&&len<=6){ if(i==0){cout<<word;i++;} else cout<<' '<<word; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:42:6: error: expected ';' before 'while' 42 | i=0 | ^ | ; 43 | while (ss >> word) { | ~~~~~
s206372088
p00084
C++
#include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> using namespace std; /* vector<string> split(const string& input, char delimiter) { istringstream stream(input); string field; vector<string> result; while (getline(stream, field, delimiter)) { result.push_back(field); } return result; } */ int main() { string str, word; int i = 0; getline(cin, str); while(str[i] != '\0'){ if(str[i] == '.' || str[i] == ',') str[i] = ' '; i++; } /* for (const string& s : split(str, ' ')) { int size = s.size(); if(size > 2 && size < 7) { cout << s << ' '; } } */ stringstream ss(str); i=0 while (ss >> word) { int len = word.length(); if(len>=3&&len<=6){ if(i==0){cout<<word;i++;} else cout<<' '<<word; } } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:42:6: error: expected ';' before 'while' 42 | i=0 | ^ | ; 43 | while (ss >> word) { | ~~~~~
s433237316
p00084
C++
#include<iostream> int main(){ std::string l[1000]; int c=0,k; while(std::cin>>l[c]) { if((l[c].find(","))+(l[c].find("."))!=-2) l[c].replace(l[c].length()-1,1,""); if( (l[c].length()>2)&&(l[c].length()<7)) c++; } for(k=0;k<c;k++) { std::cout<<l[k]; if(k!=c-1) std::cout<<" "; std::cout<<"\n"; }
a.cc: In function 'int main()': a.cc:15:2: error: expected '}' at end of input 15 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s432298516
p00084
C++
#include<iostream> #include<string> #include<algorithm> #include<functional> #include<cctype> using namespace std; struct IsAlpha:unary_function<char, bool> {bool operator()(char c)const{return isalpha(c)||c=='\'';}}; int main() { string s; getline(cin, s); string::iterator i1=s.begin(),i2; ostream_iterator<char>o(cout); int f=0; for(;;) { i2 = find_if(i1,s.end(),not1(IsAlpha())); if(i2==s.end()){*o='\n';break;} if(i2-i1>2&&i2-i1<7) (f++?(*o=' ',f):f), copy(i1,i2,o); i1=i2+1; } return 0; }
a.cc:7:16: warning: 'template<class _Arg, class _Result> struct std::unary_function' is deprecated [-Wdeprecated-declarations] 7 | struct IsAlpha:unary_function<char, bool> | ^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:49, 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_function.h:117:12: note: declared here 117 | struct unary_function | ^~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:14:9: error: 'ostream_iterator' was not declared in this scope 14 | ostream_iterator<char>o(cout); | ^~~~~~~~~~~~~~~~ a.cc:6:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>' 5 | #include<cctype> +++ |+#include <iterator> 6 | using namespace std; a.cc:14:26: error: expected primary-expression before 'char' 14 | ostream_iterator<char>o(cout); | ^~~~ a.cc:18:45: warning: 'constexpr std::unary_negate<_Predicate> std::not1(const _Predicate&) [with _Predicate = IsAlpha]' is deprecated: use 'std::not_fn' instead [-Wdeprecated-declarations] 18 | i2 = find_if(i1,s.end(),not1(IsAlpha())); | ~~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_function.h:1043:5: note: declared here 1043 | not1(const _Predicate& __pred) | ^~~~ a.cc:19:34: error: 'o' was not declared in this scope 19 | if(i2==s.end()){*o='\n';break;} | ^ a.cc:21:32: error: 'o' was not declared in this scope 21 | (f++?(*o=' ',f):f), | ^
s619702652
p00084
C++
#include<iostream> #include<string> #include<ctype> #include<vector> using namespace std; int main(){ int x,now; string s; vector<string> box; getline(cin,s); now=0; for(int i=0;i<s.size();i++){ if(s[i]!=' '&&s[i]!='.'&&s[i]!=','){ now++; } else{ if(now>=3&&now<=6) box.push_back(s.substr(i-now,now)); now=0; } } for(int i=0;i<box.size();i++){ cout<<box[i]; cout<<(box.size()-1!=i?' ':'\n'); } return 0; }
a.cc:3:9: fatal error: ctype: No such file or directory 3 | #include<ctype> | ^~~~~~~ compilation terminated.
s833510372
p00084
C++
#include<cstdio> #include<vector> using namespace std; int main(){ char str[1200]; int pos = 0; vector<string> ans; fgets(str,1200,stdin); while(1){ string word; while(str[pos] != '.' && str[pos] != ' ' && str[pos] != ',' && str[pos] != '\n')word.push_back(str[pos++]); if(str[pos] == '\n')break; if( 2<(int)word.size() && (int)word.size()<7)ans.push_back(word); pos++; } for(int i=0;i<(int)ans.size()-1;i++){ cout << ans[i] << " "; } if((int)ans.size())cout << ans[(int)ans.size()-1] << endl; }
a.cc: In function 'int main()': a.cc:8:10: error: 'string' was not declared in this scope 8 | vector<string> ans; | ^~~~~~ a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 2 | #include<vector> +++ |+#include <string> 3 | using namespace std; a.cc:8:16: error: template argument 1 is invalid 8 | vector<string> ans; | ^ a.cc:8:16: error: template argument 2 is invalid a.cc:13:11: error: expected ';' before 'word' 13 | string word; | ^~~~~ | ; a.cc:14:85: error: 'word' was not declared in this scope 14 | while(str[pos] != '.' && str[pos] != ' ' && str[pos] != ',' && str[pos] != '\n')word.push_back(str[pos++]); | ^~~~ a.cc:18:16: error: 'word' was not declared in this scope 18 | if( 2<(int)word.size() && (int)word.size()<7)ans.push_back(word); | ^~~~ a.cc:18:54: error: request for member 'push_back' in 'ans', which is of non-class type 'int' 18 | if( 2<(int)word.size() && (int)word.size()<7)ans.push_back(word); | ^~~~~~~~~ a.cc:22:26: error: request for member 'size' in 'ans', which is of non-class type 'int' 22 | for(int i=0;i<(int)ans.size()-1;i++){ | ^~~~ a.cc:23:5: error: 'cout' was not declared in this scope 23 | cout << ans[i] << " "; | ^~~~ a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<vector> +++ |+#include <iostream> 3 | using namespace std; a.cc:23:16: error: invalid types 'int[int]' for array subscript 23 | cout << ans[i] << " "; | ^ a.cc:25:15: error: request for member 'size' in 'ans', which is of non-class type 'int' 25 | if((int)ans.size())cout << ans[(int)ans.size()-1] << endl; | ^~~~ a.cc:25:22: error: 'cout' was not declared in this scope 25 | if((int)ans.size())cout << ans[(int)ans.size()-1] << endl; | ^~~~ a.cc:25:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:25:43: error: request for member 'size' in 'ans', which is of non-class type 'int' 25 | if((int)ans.size())cout << ans[(int)ans.size()-1] << endl; | ^~~~ a.cc:25:56: error: 'endl' was not declared in this scope 25 | if((int)ans.size())cout << ans[(int)ans.size()-1] << endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include<vector> +++ |+#include <ostream> 3 | using namespace std;
s897370979
p00084
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <iostream> #include <algorithm> #include <sstream> #include <string> #include <vector> #include <queue> #include <stack> #include <map> #include <set> #include <utility> #include <cctype> using namespace std; #define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i)) #define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++) char buf[1030]; inline bool ok(char c) { return c != ',' && c != ' ' && c != '.' ; } int main() { while (gets(buf)) { const int N = strlen(buf); size_t itr = 0, cnt = 0; if (ok(buf[0])) { cnt = 1; } else { itr = 1; } for (int i = 1; i < N; ++i) { if (ok(buf[i])) { ++cnt; } else { if (cnt > 2 && cnt < 7) { for (int j = itr; j < i; ++j) putchar(buf[j]); } itr = i; cnt = 0; } } puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:29:10: error: 'gets' was not declared in this scope; did you mean 'getw'? 29 | while (gets(buf)) { | ^~~~ | getw
s727727524
p00084
C++
vinclude <vector> #include <map> #include <set> #include <stack> #include <queue> #include <algorithm> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <string> #include <cstring> #include <complex> #include <ctime> #include <cstdlib> using namespace std; inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;} template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();} typedef long long ll; int main() { string sent; vector<string> word; int st = 0, ed, cnt = 0; getline(cin , sent); while(1) { if(cnt > sent.size()) { break; } if( (sent[cnt] == ',' || sent[cnt] == ' ' || sent[cnt] == '.') && st != -1) { if((cnt-st) >= 3 && (cnt-st) <= 6) { word.push_back(sent.substr(st, cnt-st)); } st = -1; } else if( (sent[cnt] != ',' && sent[cnt] != ' ' && sent[cnt] != '.') ) { if(st == -1) { st = cnt; } } cnt++; } for(int i = 0; i < word.size(); i++) { printf("%s%c", word[i].c_str(), (i == word.size()-1)?'\n':' '); } }
a.cc:1:1: error: 'vinclude' does not name a type 1 | vinclude <vector> | ^~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 | s
s504372035
p00084
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<cstring> using namespace std; int main(){ string str; getline(cin,str); str += " "; string word[1024]; int j = 0; for(int i = 0; i < str.size(); i++){ if(str[i] == '.' || str[i] == ',' || str[i] == ' ')j++; else word[j] += str[i]; } for(int i = 0; i < j; i++){ if(word[i].size() > 2 && word[i].size() < 7){ cout << word[i]; printf("%c",i==j-1?'\n':' '); } } return 0; } Win today's preliminary contest and be qualified to visit University of Aizu.
a.cc:27:10: warning: missing terminating ' character 27 | Win today's preliminary contest and be qualified to visit University of Aizu. | ^ a.cc:27:10: error: missing terminating ' character 27 | Win today's preliminary contest and be qualified to visit University of Aizu. | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:27:1: error: 'Win' does not name a type 27 | Win today's preliminary contest and be qualified to visit University of Aizu. | ^~~
s198943699
p00084
C++
#include <iostream> #include <string> using namespace std; int main(){ string in, out; bool flg = false; getline(cin, in); replace(in.begin(), in.end(), ',', ' '); replace(in.begin(), in.end(), '.', ' '); cout<<in.size()<<endl; cout<<in<<endl; for(int i=0; i<in.size(); i++){ if(in[i] == ' ' || in[i] == '\n'){ if(out.size() > 2 && out.size() < 7){ if(flg){ cout<<" "; } cout<<out; flg = true; } out = ""; }else{ out += in[i]; } } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:11:9: error: 'replace' was not declared in this scope 11 | replace(in.begin(), in.end(), ',', ' '); | ^~~~~~~
s914297859
p00084
C++
#include <iostream> #include <sstring> #include <string> using namespace std; int main(){ string in, out; bool flg = false; getline(cin, in); replace(in.begin(), in.end(), ',', ' '); replace(in.begin(), in.end(), '.', ' '); cout<<in.size()<<endl; cout<<in<<endl; for(int i=0; i<in.size(); i++){ if(in[i] == ' ' || in[i] == '\n'){ if(out.size() > 2 && out.size() < 7){ if(flg){ cout<<" "; } cout<<out; flg = true; } out = ""; }else{ out += in[i]; } } cout<<endl; return 0; }
a.cc:2:10: fatal error: sstring: No such file or directory 2 | #include <sstring> | ^~~~~~~~~ compilation terminated.
s840382590
p00084
C++
import java.io.*; public class aoj0084 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String tmp = br.readLine(); int cnt = 0; String[] ans = new String[1024]; char[] s = tmp.toCharArray(); for(int i=0;i<s.length;i++){ if(s[i] == ',' || s[i] == '.') s[i]= ' '; } tmp = String.valueOf(s); String[] data = tmp.split(" "); for(int i=0;i<data.length;i++){ if(data[i].length() > 2 && data[i].length() < 7) { ans[cnt] = data[i]; cnt++; } } for(int i=0;i<cnt;i++){ if(i == cnt-1) System.out.println(ans[i]); else System.out.print(ans[i] + " "); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ 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 aoj0084 { | ^~~~~~
s305095060
p00084
C++
import java.io.*; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String tmp = br.readLine(); int cnt = 0; String[] ans = new String[1024]; char[] s = tmp.toCharArray(); for(int i=0;i<s.length;i++){ if(s[i] == ',' || s[i] == '.') s[i]= ' '; } tmp = String.valueOf(s); String[] data = tmp.split(" "); for(int i=0;i<data.length;i++){ if(data[i].length() > 2 && data[i].length() < 7) { ans[cnt] = data[i]; cnt++; } } for(int i=0;i<cnt;i++){ if(i == cnt-1) System.out.println(ans[i]); else System.out.print(ans[i] + " "); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ 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 { | ^~~~~~
s441141057
p00084
C++
#include<iostream> int main(){ char s[1024+1]; std::cin >> s; char k[6+1]; int l=0; while(){ if(*s == '.' || *s == ',' || *s == ' ' || *s == '\0'){ if(l>=3 && l<=6){ k[l] = '\0'; std::cout << k << " "; } l=0; if(*s=='\0') break; } k[l] = *s; ++l; } }
a.cc: In function 'int main()': a.cc:8:15: error: expected primary-expression before ')' token 8 | while(){ | ^
s136816717
p00084
C++
#include<iostream> int main(){ char s[1024+1]; char k[6+1]; int l=0; std::cin >> s; while(1){ if(*s == '.' || *s == ',' || *s == ' ' || *s == '\0'){ if(l>=3 && l<=6){ k[l] = '\0'; std::cout << k << " "; } l=0; if(*s=='\0') break; } k[l] = *s; ++l; ++s; } }
a.cc: In function 'int main()': a.cc:22:19: error: lvalue required as increment operand 22 | ++s; | ^
s404252406
p00084
C++
/* 0084:Search Engine */ #include <iostream> #include <conio> #include <string> using namespace std; bool IsBreakChar(char c); int main(void) { string str; bool IsFirst = true; getline(cin, str); int strln = (int)str.length(); string word; for(int i = 0; i < strln; i++) { /*str[i]の文字列は区切り文字か?*/ if( IsBreakChar(str[i]) ) { int wordln = (int)word.length(); /*wordの文字列の長さは条件に合っているか?*/ if(wordln >= 3 && wordln <= 6) { /*出力するのは初めてではないか?*/ if(IsFirst == false) { cout << ' '; } cout << word; IsFirst = false; } word.clear(); } else { word += str[i]; } } cout << endl; return 0; } bool IsBreakChar(char c) { char brch[3] = { ' ', ',', '.' }; for(int i = 0; i < 3; i++) { if(brch[i] == c) { return true; } } return false; }
a.cc:5:17: fatal error: conio: No such file or directory 5 | #include <conio> | ^~~~~~~ compilation terminated.
s563497946
p00084
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; getline(cin,s); char *q,*p,*c=new char[sizeof(s)+1]; int f=0,n; strncpy_s(c,s.size()+1,s.c_str(),s.size()+1); p=strtok_s(c," .,",&q); while(p!=NULL){ n=string(p).size(); if(3<=n&&n<=6){ cout<<((f==1)?" ":"\0")<<p; f=1; } p=strtok_s(NULL," .,",&q); } cout<<endl; }
a.cc: In function 'int main()': a.cc:9:9: error: 'strncpy_s' was not declared in this scope 9 | strncpy_s(c,s.size()+1,s.c_str(),s.size()+1); | ^~~~~~~~~ a.cc:10:11: error: 'strtok_s' was not declared in this scope; did you mean 'strtol_l'? 10 | p=strtok_s(c," .,",&q); | ^~~~~~~~ | strtol_l
s063611227
p00084
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; getline(cin,s); char *q,*p,*c=new char[sizeof(s)+1]; int f=0,n; strncpy(c,s.c_str(),s.size()+1); p=strtok(c," .,"); while(p!=NULL){ n=string(p).size(); if(3<=n&&n<=6){ cout<<((f==1)?" ":"\0")<<p; f=1; } p=strtok(NULL," .,"); } cout<<endl; }
a.cc: In function 'int main()': a.cc:9:9: error: 'strncpy' was not declared in this scope 9 | strncpy(c,s.c_str(),s.size()+1); | ^~~~~~~ a.cc:2:1: note: 'strncpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | #include <string> a.cc:10:11: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 10 | p=strtok(c," .,"); | ^~~~~~ | strtoq
s799942052
p00084
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; int i; getline(cin, s); for(i=0;i<s.size();i++) if(s[i]==','||s[i]=='.')s[i]=' '; stringstream ss; ss<<s; int f=0,n; while(ss>>s){ n=s.size(); if(n>=3&&n<=6){ cout<<((f==1)?" ":"")<<s; f=1; } } cout<<endl; }
a.cc: In function 'int main()': a.cc:10:22: error: aggregate 'std::stringstream ss' has incomplete type and cannot be defined 10 | stringstream ss; | ^~
s195205555
p00085
C
#include<stdio.h> int a[1010],m,n,i,b,c; int main(){ scanf("%d%d",&n,&m); while(n!=0 && m!=0){ for(i=1;i<=n;i++)a[i]=1; b=i=n; while(a>1){ c=0; while(c<m){ i++;if(i>n)i=1; c+=b[i]; } a[i]=0;b--; } for(i=1;i<=n;i++)if(a[i]==1)printf("%d\n",i); scanf("%d%d",&n,&m); } return 0; }
main.c: In function 'main': main.c:10:16: warning: comparison between pointer and integer 10 | while(a>1){ | ^ main.c:14:21: error: subscripted value is neither array nor pointer nor vector 14 | c+=b[i]; | ^
s363860520
p00085
C
#include<stdio.h> int main(void) { int n,m,i,j,count; int num[1001]; while(scanf("%d%d",&n,&m),n+m){ count=0; for(i=0;i<1001;i++){ num[i]=0; } for(i=0;i<n+1;i++){ num[i]=i; } for(i=m;n-count>m;i+=m-1){ if(i>=n-count){ i%=n-count; }count++; for(j=i;j<n+1;j++){ num[j]=num[j+1]; } } for(;n-count>2;i+=(m-1)%(n-count)){ if(i>=n-count){ i%=n-count; }count++; for(j=i;j<n+1;j++){ num[j]=num[j+1]; } } // for(i=1;i<=n;i++) printf("%d\n",num[1]); //puts(""); // } return 0; }
main.c: In function 'main': main.c:46:1: error: expected declaration or statement at end of input 46 | } | ^
s013505253
p00085
C
void potato(int n,int m){ int i; int x[n]; //x[0]をn人目とする //x[i]:iの右隣の数字を格納 for(i=0;i<n;i++){ if(i==n-1)x[i]=0; else x[i]=i+1; } int prev,now=0; int count=0; while(count<=m*(n-1)){ prev=now; now=x[now]; count++; if(count%m==0)x[prev]=x[now]; } printf("%d\n",now); return 0; }
main.c: In function 'potato': main.c:20:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 20 | printf("%d\n",now); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | main.c:20:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 20 | printf("%d\n",now); | ^~~~~~ main.c:20:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:21:8: error: 'return' with a value, in function returning void [-Wreturn-mismatch] 21 | return 0; | ^ main.c:2:6: note: declared here 2 | void potato(int n,int m){ | ^~~~~~
s998897177
p00085
C
#include <iostream> int main(int argc,char* argv[]){ bool peeple[1001]; while(true){ int pop,space; std::cin >> pop >> space; if(pop == 0 && space == 0){break;} for(int i = 1; i <= pop; i++){ peeple[i] = false; } int cur_pop = pop; int cur_num = 1; while(cur_pop != 1){ int count = 0; while(count < (space-1) || peeple[cur_num] == true){ if(peeple[cur_num] == true){ if(cur_num == pop){ cur_num = 1; }else{ cur_num++; } continue; }else{ if(cur_num == pop){ cur_num = 1; }else{ cur_num++; } count++; } } peeple[cur_num] = true; cur_pop--; while(peeple[cur_num] == true){ if(cur_num == pop){ cur_num = 1; }else{ cur_num++; } } } for(int i = 1; i <= pop;i++){ if(peeple[i] == false){ std::cout << i << std::endl; break; } } } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s326766100
p00085
C
#include <stdio.h> #define MAX 1000 int main(void){ int n,m,num[MAX],i,cnt,j; while(1){ cnt = 0; for(i = 0; i < MAX ; i++) num[i] = 0; scanf("%d %d", &n ,&m); if(n == 0 && m == 0) break; for(i = 0 ; i < n ; i++) num[i] = i+1; j = 1; while(1){ if(cnt == n - 1) break; num[m-1] = 0; j++; m*=j; if(m > n) m -= n; } for(i = 0 ; i < n ; i++){ if(num[i] != 0) print("%d\n" ,num[i]); } } return 0; }
main.c: In function 'main': main.c:24:23: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 24 | if(num[i] != 0) print("%d\n" ,num[i]); | ^~~~~ | printf
s792417420
p00085
C++
import std.stdio,std.string,std.conv; int main() { string s; int a[1001]; while((s = readln.chomp).length != 0) { string[] _s = s.split(" "); int n = _s[0].to!int; int m = _s[1].to!int; if(n == 0 && m == 0) { break; } foreach(i;0..n) { a[i] = 1; } int count = 0; int delete_count = 0; for(int i=0; i < n ; i++) { if(delete_count == n-1) { break; } if(a[i] == 1) { count++; if(count == m) { a[i] = 0; count = 0; delete_count++; } } if(i == n-1) { i = -1; } } foreach(i;0..n) { if(a[i] == 1) { (i+1).writeln; } } } return 0; }
a.cc:18:27: error: too many decimal points in number 18 | foreach(i;0..n) | ^~~~ a.cc:51:27: error: too many decimal points in number 51 | foreach(i;0..n) | ^~~~ a.cc:1:1: error: 'import' does not name a type 1 | import std.stdio,std.string,std.conv; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc: In function 'int main()': a.cc:5:9: error: 'string' was not declared in this scope 5 | string s; | ^~~~~~ a.cc:7:16: error: 's' was not declared in this scope 7 | while((s = readln.chomp).length != 0) | ^ a.cc:7:20: error: 'readln' was not declared in this scope 7 | while((s = readln.chomp).length != 0) | ^~~~~~ a.cc:9:24: error: expected primary-expression before ']' token 9 | string[] _s = s.split(" "); | ^ a.cc:10:25: error: '_s' was not declared in this scope 10 | int n = _s[0].to!int; | ^~ a.cc:18:25: error: 'i' was not declared in this scope 18 | foreach(i;0..n) | ^ a.cc:51:26: error: expected ')' before ';' token 51 | foreach(i;0..n) | ~ ^ | )
s276597095
p00085
C++
#include<stdio.h> int main() { bool num[1001]={}; int N,M; int ii=0; int cou=0; while(1){ scanf("%d %d",&N,&M); if(N==0&&M==)break; for(int i=0;i<1000;i++) num[i]=true; do{ if(num[ii]==true){cou++;num[ii]=false;} ii=(ii+1)%M; }while(cou<N-1) for(int i=0;i<N;i++){int t=i+1; if(num[i]==true;)printf("%d\n",t); ii=0;cou=0; for(int i=0;i<1000;i++) num[i]=true;} return 0; }
a.cc: In function 'int main()': a.cc:12:13: error: expected primary-expression before ')' token 12 | if(N==0&&M==)break; | ^ a.cc:22:16: error: expected ';' before 'for' 22 | }while(cou<N-1) | ^ | ; 23 | 24 | for(int i=0;i<N;i++){int t=i+1; | ~~~ a.cc:25:17: error: expected primary-expression before ')' token 25 | if(num[i]==true;)printf("%d\n",t); | ^ a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s127210566
p00085
C++
#include <string.h> #include <iostream> #include<time.h> using namespace std; int main() { const int MAX_DATAS = 1000; int N[MAX_DATAS], M[MAX_DATAS], CHECK[1099], ANS[MAX_DATAS], C1 = 0, C = 1, D = 1, E = 0; while (true) { memset(CHECK, -1, sizeof(CHECK)); // -1 C = 1; D = 1; E = 0; cin >> N[C1] >> M[C1]; if (M[C1] == 1) { ANS[C1] = N[C1]; goto Exit2:; } if (N[C1] == 0 && M[C1] == 0) { goto Exit3; } while (true) { if (CHECK[C] % M[C1] != 0) { CHECK[C] = D; if (D % M[C1] == 0) { E++; } D++; } C++; if (C > N[C1]) { C -= N[C1]; } if (E == N[C1]) { goto Exit1; } } Exit1:; for (int i = 1; i <= N[C1]; i++) { CHECK[i] /= M[C1]; } for (int i = 1; i <= N[C1]; i++) { if (CHECK[i] == N[C1]) { ANS[C1] = i; } } Exit2:; C1++; } Exit3:; for (int i = 0; i < C1; i++) { cout << ANS[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:62: error: expected ';' before ':' token 21 | if (M[C1] == 1) { ANS[C1] = N[C1]; goto Exit2:; } | ^ | ; a.cc:21:62: error: expected primary-expression before ':' token
s876089542
p00085
C++
import java.util.*; class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ int leng = sc.nextInt();boolean[] p = new boolean[leng]; int t = sc.nextInt(), pleng = p.length; if(pleng==0 & t==0) break; Arrays.fill(p, true); int tcount = pleng, count = 0; while(tcount!=1){ for(int i = 0;i < t;){ count++; count = count%pleng; if(p[count])i++; } p[count] = false; tcount--; } int ans = 0; while(p[ans] == false ) ans++; if(ans==0) ans = pleng; System.out.println(ans); } } }
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:3:15: error: expected ':' before 'static' 3 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:3:33: error: 'String' has not been declared 3 | public static void main(String[] args) { | ^~~~~~ a.cc:3:42: error: expected ',' or '...' before 'args' 3 | public static void main(String[] args) { | ^~~~ a.cc:27:2: error: expected ';' after class definition 27 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:4:17: error: 'Scanner' was not declared in this scope 4 | Scanner sc = new Scanner(System.in); | ^~~~~~~ a.cc:5:23: error: 'sc' was not declared in this scope 5 | while(sc.hasNext()){ | ^~ a.cc:6:49: error: 'boolean' was not declared in this scope; did you mean 'bool'? 6 | int leng = sc.nextInt();boolean[] p = new boolean[leng]; | ^~~~~~~ | bool a.cc:6:57: error: expected primary-expression before ']' token 6 | int leng = sc.nextInt();boolean[] p = new boolean[leng]; | ^ a.cc:8:28: error: 'pleng' was not declared in this scope; did you mean 'leng'? 8 | if(pleng==0 & t==0) break; | ^~~~~ | leng a.cc:9:25: error: 'Arrays' was not declared in this scope 9 | Arrays.fill(p, true); | ^~~~~~ a.cc:9:37: error: 'p' was not declared in this scope 9 | Arrays.fill(p, true); | ^ a.cc:10:38: error: 'pleng' was not declared in this scope; did you mean 'leng'? 10 | int tcount = pleng, count = 0; | ^~~~~ | leng a.cc:13:41: error: 'count' was not declared in this scope; did you mean 'tcount'? 13 | count++; | ^~~~~ | tcount a.cc:17:35: error: 'count' was not declared in this scope; did you mean 'tcount'? 17 | p[count] = false; | ^~~~~ | tcount a.cc:23:25: error: 'System' was not declared in this scope 23 | System.out.println(ans); | ^~~~~~
s076700367
p00085
C++
#include<iostream> #include<vector> using namespace std; int main(){ int n,k,m,i; for(;cin>>n>>k,n;;){ vector<int>vec(n); for(i=0;i<n;i++)vec[i]=i+1; i=(m-1)%vec.size(); vec.erase(vec.begin()+i); for(;vec.size()>1;vec.erase(vec.begin()+i))if(i+=(k-1)%vec.size(),i>=vec.size())i-=vec.size(); cout<<vec[0]<<endl; } }
a.cc: In function 'int main()': a.cc:6:26: error: expected primary-expression before ';' token 6 | for(;cin>>n>>k,n;;){ | ^ a.cc:6:26: error: expected ')' before ';' token 6 | for(;cin>>n>>k,n;;){ | ~ ^ | ) a.cc:6:27: error: expected primary-expression before ')' token 6 | for(;cin>>n>>k,n;;){ | ^
s618962022
p00085
C++
#include<iostream> using namespace std; int potato(int x, int y) { for(int i=y-2; i<(y-2)*x; i=(i*y)/(y-1)+1) return(x*y-i); } int main() { while(cin>>x>>y, x || y) { cout<<potato(x,y)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:13: error: 'x' was not declared in this scope 11 | while(cin>>x>>y, x || y) | ^ a.cc:11:16: error: 'y' was not declared in this scope 11 | while(cin>>x>>y, x || y) | ^ a.cc: In function 'int potato(int, int)': a.cc:8:2: warning: control reaches end of non-void function [-Wreturn-type] 8 | } | ^
s595585953
p00085
C++
#include <iostream> using namespace std; int pt(int n, int m){ for(int i = m-1 ; i < (m-1)*n ; i = (m*i) / (m-1)+1); return (m*n-i); } int main(){ int n,m; while( cin >> n >> m , n || m ) cout << pt(n,m) << endl; return 0; }
a.cc: In function 'int pt(int, int)': a.cc:6:15: error: 'i' was not declared in this scope 6 | return (m*n-i); | ^
s088413899
p00085
C++
#include <iostream> using namespace std; int pt(int n, int m){ int i; for(i = m-1 ; i < (m-1)*n ; i = (m*i) / (m-1)+1); return (m*n-i); } int main(){ int n,m; while( cin >> n >> k , n || k ) cout << pt(n,m) << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:22: error: 'k' was not declared in this scope 13 | while( cin >> n >> k , n || k ) cout << pt(n,m) << endl; | ^
s529183205
p00085
C++
#include <stdio.h> #include<math.h> #include <string.h> #include <ctype.h> int main(){ int a[1001],i,n,m,f,t; while(1){ scanf("%d %d",&n,&m); if(n==0&&m==0)break; for(i=1;i<=n;i++)a[i]=i; i=1; f=0; t=0; while(1){ if(t==n-1)break; if(a[i]!=0)f++; if(f==m){ a[i]=0; t++; f=0; } i++; if(i==n+1)i=1; } for(i=1;i<=n;i++){ if(a[i]!=0){ printf("%d\n",a[i]); } } return 0; }
a.cc: In function 'int main()': a.cc:33:2: error: expected '}' at end of input 33 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s006411122
p00085
C++
while 1: n,m=map(int,raw_input().split()) if n==0&m==0:break G=range(1,n+1) while n>1: if m%n==0:G=G[:n-1] else:G=G[m%n:]+G[:(m-1)%n] n-=1 print G[0]
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while 1: | ^~~~~
s295732527
p00086
Java
public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (scanner.hasNext()) { int[] map = new int[101]; while (true) { int n = scanner.nextInt(); int s = scanner.nextInt(); if (n == 0 && s == 0) { break; } map[n]++; map[s]++; } int count = 0; for (int i = 0; i < 101; i++) { if (map[i] % 2 == 1) { count++; } } if (count != 2) { System.out.println("NG"); } else if (map[1] % 2 == 1 && map[2] % 2 == 1) { System.out.println("OK"); } else { System.out.println("NG"); } } } }
Main.java:5: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner scanner = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s986473430
p00086
Java
import java.io.*; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { public static void main(String[] args) { FastScanner sc = new FastScanner(); Scanner stdIn = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); while(sc.hasNext()) { int[] list = new int[1000]; while(true) { int a = sc.nextInt(); int b = sc.nextInt(); if(a == 0 && b == 0) break; list[a]++; list[b]++; } int e = 0; int o = 0; for(int i = 0; i < list.length; i++) { if(list[i] % 2 == 0) { e++; } else { o++; } if(o > 2) break; } out.println(((list[1] % 2 == 1 && list[2] % 2 == 1 && o == 2)?"OK":"NG"); } out.flush(); } } class LL { int size; Node now; LL(int n) { now = new Node(null,null,1); Node tmp = new Node(null,null,2); now.next = tmp; now.prev = tmp; tmp.next = now; tmp.prev = now; size = n; now = tmp; for(int i = 2; i < n; i++) { add(i+1); } } void add(int a) { Node tmp = new Node(null,null,a); tmp.next = now.next; tmp.prev = now; now.next.prev = tmp; now.next = tmp; now = tmp; } void remove() { now.prev.next = now.next; now.next.prev = now.prev; now = now.next; size--; } } class Node { Node next; Node prev; int id; Node(Node a, Node b, int c) { next = a; prev = b; id = c; } } //------------------------------// //-----------// class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private boolean hasNextByte() { if (ptr < buflen) { return true; }else{ ptr = 0; try { buflen = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;} private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;} private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;} public boolean hasNext() { skipUnprintable(); return hasNextByte();} public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while(isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while(true){ if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; }else if(b == -1 || !isPrintableChar(b)){ return minus ? -n : n; }else{ throw new NumberFormatException(); } b = readByte(); } } public int nextInt() { return (int)nextLong(); } }
Main.java:37: error: ')' or ',' expected out.println(((list[1] % 2 == 1 && list[2] % 2 == 1 && o == 2)?"OK":"NG"); ^ 1 error
s531167011
p00086
Java
import java.util.*; public class Mai { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { boolean f[] = new boolean[105]; int c = 0; for(;;) { int a = sc.nextInt(), b = sc.nextInt(); if( (a|b) == 0 ) break; f[a] = !f[a]; f[b] = !f[b]; c += f[a]? 1: -1; c += f[b]? 1: -1; } System.out.println( (c>3? "NG": "OK") ); } } }
Main.java:2: error: class Mai is public, should be declared in a file named Mai.java public class Mai { ^ 1 error
s944438171
p00086
Java
import java.util.Arrays; import java.util.Scanner; public class Maim { Scanner sc; boolean solve(int[] edges){ for(int i=2;i<100;++i){ if(edges[i]%2!=0){ return false; } } if((edges[0]+edges[1])%2!=0)return false; else{ return true; } } int ni(){ return sc.nextInt(); } void io(){ int[] edges=new int[100]; sc=new Scanner(System.in); while(sc.hasNext()){ Arrays.fill(edges, 0); int a,b; while(true){ a=ni();b=ni(); if(a==0&&b==0)break; edges[a-1]++;edges[b-1]++; } System.out.println(solve(edges)?"OK":"NG"); } sc.close(); } public static void main(String[] args) { // TODO Auto-generated method stub new Maim().io(); } }
Main.java:5: error: class Maim is public, should be declared in a file named Maim.java public class Maim { ^ 1 error
s185846124
p00086
Java
public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int array[]=new int[50]; int count=0,a,b; while(true){ for(int i=0;i<50;i++){ array[i]=0; } while(true){ a=scan.nextInt(); b=scan.nextInt(); array[a]++; array[b]++; if(a==0){ if(b==0){ break; } } } for(int i=0;i<50;i++){ if(array[1]%2==1&&array[2]==2){ if(array[i]%2==0){ if(i==50){ System.out.println("OK"); } } else{ System.out.println("NG"); break; } } else{ System.out.println("NG"); break; } } if(!scan.hasNext()){ break; } } } }
Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s989356376
p00086
C++
#include<iostream> using namespace std; int cnt[200]; main() { int a,b; while(cin>>a>>b) { for(int i=1;i<=100;i++)cnt[i]=0; cnt[a]++,cnt[b]++; while(cin>>a>>b,a)cnt[a]++,cnt[b]++; int c=0;a=b=0; for(int i=1;i<=100;i++) { c+=cnt[i]%2; if(cnt[i]%2) { if(a)b=i; else a=i; } cout<<(c==0?"OK":c==2&&a==1&&b==2?"OK":"NG")<<endl; } }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~ a.cc: In function 'int main()': a.cc:23:2: error: expected '}' at end of input 23 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s402890915
p00086
C++
#include <iostream> #include <algorithm> using namespace std; int path[101]; int main(void) { int a, b; while (cin >> a >> b) { if(a == 0 && b == 0) { bool ans = all_of(path + 3, path + 100, [=](int n){return n % 2 == 0;}); cout << (ans ? "OK" : "NG") << endl; memset(path, 0, sizeof(path)); } path[a]++; path[b]++; } return 0; }
a.cc: In function 'int main()': a.cc:16:25: error: 'memset' was not declared in this scope 16 | memset(path, 0, sizeof(path)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cstring> 3 |
s995111667
p00086
C++
#include <iostream> #include <algorithm> using namespace std; int path[101]; int main(void) { int a, b; while (cin >> a >> b) { if(a == 0 && b == 0) { bool ans = all_of(path + 3, path + 100, [=](int n){return n % 2 == 0;}); cout << (ans ? "OK" : "NG") << endl; memset(path, 0, sizeof(path)); } path[a]++; path[b]++; } return 0; }
a.cc: In function 'int main()': a.cc:16:25: error: 'memset' was not declared in this scope 16 | memset(path, 0, sizeof(path)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cstring> 3 |
s305923890
p00086
C++
#include <iostream> #include <cstdio> using namespace std; int list[100]; int main(void){ int a, b, odd = 0; while(scanf("%d %d", &a, &b) != EOF){ if(a || b){ list[a-1]++; list[b-1]++; }else{ for(int i = 0; i < 100; i++){ if(list[i] % 2 != 0) odd++; } if(odd == 2){ printf("OK\n"); memset(list, 0, 100); }else{ printf("NG\n"); memset(list, 0, 100); } } } return 0; }
a.cc: In function 'int main()': a.cc:18:33: error: 'memset' was not declared in this scope 18 | memset(list, 0, 100); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | using namespace std; a.cc:21:33: error: 'memset' was not declared in this scope 21 | memset(list, 0, 100); | ^~~~~~ a.cc:21:33: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s873392237
p00086
C++
#include <cstring> #include <cstdio> #include <cstring> using namespace std; int list[100]; int main(void){ int a, b; bool flag = false; while(scanf("%d %d", &a, &b)){ memset(list, 0, 100); list[a-1]++; list[b-1]++; while(true){ cin >> a >> b; if(!a && !b) break; list[a-1]++; list[b-1]++; } flag = false; if(!(list[0] & 1) || !(list[1] & 1)) flag = true; for(int i = 2; i < 100; i++){ if(list[i] & 1) flag = true; } if(!flag) printf("OK\n"); else printf("NG\n"); } return 0; }
a.cc: In function 'int main()': a.cc:16:25: error: 'cin' was not declared in this scope 16 | cin >> a >> b; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include <cstring> +++ |+#include <iostream> 4 | using namespace std;
s867136218
p00086
C++
#include<iostream> using namespace std; int main() { while(cin>>a>>b) { int hen[51]={}; hen[a]++; hen[b]++; if(a==0){ if(hen[1]%2==1&&hen[2]%2==1&& for(int i=3;i<51;i++)hen[i]%2==0)) cout<<"OK"<<endl; else cout<<"NG"<<endl; for(int i=0;i<51;i++) hen[i]=0; } } return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: 'a' was not declared in this scope 6 | while(cin>>a>>b) | ^ a.cc:6:19: error: 'b' was not declared in this scope 6 | while(cin>>a>>b) | ^ a.cc:13:16: error: expected primary-expression before 'for' 13 | for(int i=3;i<51;i++)hen[i]%2==0)) | ^~~ a.cc:12:42: error: expected ')' before 'for' 12 | if(hen[1]%2==1&&hen[2]%2==1&& | ~ ^ | ) 13 | for(int i=3;i<51;i++)hen[i]%2==0)) | ~~~ a.cc:13:28: error: 'i' was not declared in this scope 13 | for(int i=3;i<51;i++)hen[i]%2==0)) | ^ a.cc:15:13: error: expected '}' before 'else' 15 | else | ^~~~ a.cc:11:17: note: to match this '{' 11 | if(a==0){ | ^ a.cc: At global scope: a.cc:22:5: error: expected unqualified-id before 'return' 22 | return 0; | ^~~~~~ a.cc:23:1: error: expected declaration before '}' token 23 | } | ^
s239384288
p00086
C++
#include<iostream> using namespace std; int main() { while(cin>>a>>b) { int hen[101]={}; hen[a]++; hen[b]++; if(a==0){ if(hen[1]%2==1&&hen[2]%2==1) { for(int i=3;i<101;i++){ if(i<=100&&hen[i]%2==1) cout<<"NG"<<endl; if(i==100)cout<<"OK"<<endl; else cout<<"BG"<<endl; } for(int i=0;i<101;i++) hen[i]=0; } } return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: 'a' was not declared in this scope 6 | while(cin>>a>>b) | ^ a.cc:6:19: error: 'b' was not declared in this scope 6 | while(cin>>a>>b) | ^ a.cc:27:2: error: expected '}' at end of input 27 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s497503420
p00086
C++
#include<iostream> using namespace std; int main() { while(cin>>a>>b) { int hen[101]={}; hen[a-1]++; hen[b-1++; if(a==0){ if(hen[0]%2==1&&hen[1]%2==1) { for(int i=2;i<101;i++){ if(i<100&&hen[i]%2==1) cout<<"NG"<<endl; if(i==100)cout<<"OK"<<endl; else cout<<"BG"<<endl; } for(int i=0;i<101;i++) hen[i]=0; } } return 0; }
a.cc: In function 'int main()': a.cc:7:16: error: 'a' was not declared in this scope 7 | while(cin>>a>>b) | ^ a.cc:7:19: error: 'b' was not declared in this scope 7 | while(cin>>a>>b) | ^ a.cc:11:15: error: lvalue required as increment operand 11 | hen[b-1++; | ^ a.cc:11:18: error: expected ']' before ';' token 11 | hen[b-1++; | ^ | ] a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s697431646
p00086
C++
#include<iostream> using namespace std; int main() { int a,b; int hen[101]={}; while(cin>>a>>b) { hen[a-1]++; hen[b-1]++; if(a==0){ if(hen[0]%2==1&&hen[1]%2==1) { for(int i=2;i<101;i++){ if(i<100&&hen[i]%2==1) cout<<"NG"<<endl; if(i==100)cout<<"OK"<<endl; else cout<<"NG"<<endl; } for(int i=0;i<101;i++) hen[i]=0; } } return 0; }
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s032204503
p00086
C++
#include<iostream> using namespace std; int main() { int a,b; int hen[100]={}; while(cin>>a>>b) { hen[a-1]++; hen[b-1]++; if(a==0){ if(hen[0]%2==1&&hen[1]%2==1){ for(int i=2;i<101;i++){ if(i<100&&hen[i]%2==1){ cout<<"NG"<<endl; break; } if(i==100)cout<<"OK"<<endl; } else cout<<"NG"<<endl; for(int i=0;i<100;i++) hen[i]=0; } } } return 0; }
a.cc: In function 'int main()': a.cc:22:17: error: expected '}' before 'else' 22 | else | ^~~~ a.cc:13:41: note: to match this '{' 13 | if(hen[0]%2==1&&hen[1]%2==1){ | ^ a.cc: At global scope: a.cc:31:5: error: expected unqualified-id before 'return' 31 | return 0; | ^~~~~~ a.cc:32:1: error: expected declaration before '}' token 32 | } | ^
s637689341
p00086
C++
#include<iostream> using namespace std; int main() { int a,b; int hen[100]={}; while(cin>>a>>b) { hen[a-1]++; hen[b-1]++; if(a==0){ if(hen[0]%2==1&&hen[1]%2==1){ for(int i=2;i<101;i++){ if(i<100&&hen[i]%2==1){ cout<<"NG"<<endl; break; } if(i==100)cout<<"OK"<<endl; } } else cout<<"NG"<<endl; for(int i=0;i<100;i++) hen[i]=0; } } } return 0; }
a.cc:32:5: error: expected unqualified-id before 'return' 32 | return 0; | ^~~~~~ a.cc:33:1: error: expected declaration before '}' token 33 | } | ^
s052323603
p00086
C++
#include<iostream> using namespace std; int main() { int a,b; int hen[100]={0}; while(cin>>a>>b) { hen[a-1]++; hen[b-1]++; if(a==0){ if(hen[0]%2==1&&hen[1]%2==1){ for(int i=2;i<101;i++){ if(i<100&&hen[i]%2==1){ cout<<"NG"<<endl; break; } if(i==100)cout<<"OK"<<endl; } } else cout<<"NG"<<endl; for(int i=0;i<100;i++) hen[i]=0; } } } return 0; }
a.cc:31:5: error: expected unqualified-id before 'return' 31 | return 0; | ^~~~~~ a.cc:32:1: error: expected declaration before '}' token 32 | } | ^
s141125480
p00086
C++
namespace std; int a, b, c; int s[51][101]={}; int main() { c=0; while(cin >> a >> b) { if(a!=0) { s[c][a]++; s[c][b]++; } else { s[c][1]++; s[c][2]++; int t=0; for(int i=1; i<=100; i++) { if(s[c][i]%2!=0) { t++; break; } } if(t==0) { cout << "OK" << endl; } else { cout << "NG" << endl; } c++; } } return 0; }
a.cc:1:14: error: expected '{' before ';' token 1 | namespace std; | ^ a.cc: In function 'int main()': a.cc:8:15: error: 'cin' was not declared in this scope 8 | while(cin >> a >> b) | ^~~ a.cc:30:33: error: 'cout' was not declared in this scope 30 | cout << "OK" << endl; | ^~~~ a.cc:30:49: error: 'endl' was not declared in this scope 30 | cout << "OK" << endl; | ^~~~ a.cc:34:33: error: 'cout' was not declared in this scope 34 | cout << "NG" << endl; | ^~~~ a.cc:34:49: error: 'endl' was not declared in this scope 34 | cout << "NG" << endl; | ^~~~
s418646993
p00086
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int judge(vector<int> &a) { for (int i = 2; i < a.size(); ++i) { if (a[i] % 2 == 1) { return 1; break; } } return 0; } void output(const char str[]) { cout << str << endl; } int main() { int aa, bb,size=0; vector<int> a; while (cin >> aa >> bb&&aa != 0 && bb != 0) { if (aa > a.size() || bb > a.size()) { a.resize(max(aa, bb) - a.size()); fill_n(&a + size, max(aa, bb) - size, 0); size = a.size(); } a[aa - 1] += 1; a[bb - 1] += 1; } if (a[0] % 2 == 1 && a[1] % 2 == 1 && judge(a) == 0) output("OK"); else output("NG"); }
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: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = vector<int>*; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]': /usr/include/c++/14/bits/stl_algobase.h:998:21: required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = vector<int>*; _Tp = int]' 998 | { std::__fill_a1(__first, __last, __value); } | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1154:20: required from '_OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = vector<int>*; _Size = int; _Tp = int]' 1154 | std::__fill_a(__first, __first + __n, __value); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1183:29: required from '_OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = vector<int>*; _Size = int; _Tp = int]' 1183 | return std::__fill_n_a(__first, std::__size_to_integer(__n), __value, | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1184 | std::__iterator_category(__first)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:26:10: required from here 26 | fill_n(&a + size, max(aa, bb) - size, 0); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:952:18: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'const int') 952 | *__first = __tmp; | ~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/vector:72, from a.cc:2: /usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]' 210 | vector<_Tp, _Alloc>:: | ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from 'const int' to 'const std::vector<int>&' 211 | operator=(const vector<_Tp, _Alloc>& __x) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66: /usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:766:26: note: no known conversion for argument 1 from 'const int' to 'std::vector<int>&&' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]' 788 | operator=(initializer_list<value_type> __l) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:788:46: note: no known conversion for argument 1 from 'const int' to 'std::initializer_list<int>' 788 | operator=(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
s957792859
p00086
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int judge(vector<int> &a,int k) { for (int i = 2; i < k; ++i) { if (a[i] % 2 == 1) { return 1; break; } } return 0; } void output(const char str[]) { cout << str << endl; } int main() { int aa, bb,size=0; vector<int> a; while (cin >> aa >> bb&&aa != 0 && bb != 0) { if (aa > size || bb > size) { a.resize(max(aa, bb) - a.size()); fill_n(&a + size, max(aa, bb) - size, 0); size = a.size(); } a[aa - 1] += 1; a[bb - 1] += 1; } if (a[0] % 2 == 1 && a[1] % 2 == 1 && judge(a,a.size()) == 0) output("OK"); else output("NG"); }
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: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = vector<int>*; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]': /usr/include/c++/14/bits/stl_algobase.h:998:21: required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = vector<int>*; _Tp = int]' 998 | { std::__fill_a1(__first, __last, __value); } | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1154:20: required from '_OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = vector<int>*; _Size = int; _Tp = int]' 1154 | std::__fill_a(__first, __first + __n, __value); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1183:29: required from '_OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = vector<int>*; _Size = int; _Tp = int]' 1183 | return std::__fill_n_a(__first, std::__size_to_integer(__n), __value, | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1184 | std::__iterator_category(__first)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:26:10: required from here 26 | fill_n(&a + size, max(aa, bb) - size, 0); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:952:18: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'const int') 952 | *__first = __tmp; | ~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/vector:72, from a.cc:2: /usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]' 210 | vector<_Tp, _Alloc>:: | ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from 'const int' to 'const std::vector<int>&' 211 | operator=(const vector<_Tp, _Alloc>& __x) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66: /usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:766:26: note: no known conversion for argument 1 from 'const int' to 'std::vector<int>&&' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]' 788 | operator=(initializer_list<value_type> __l) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:788:46: note: no known conversion for argument 1 from 'const int' to 'std::initializer_list<int>' 788 | operator=(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
s927443471
p00086
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int judge(vector<int> a,int k) { for (int i = 2; i < k; ++i) { if (a[i] % 2 == 1) { return 1; break; } } return 0; } void output(const char str[]) { cout << str << endl; } int main() { int aa, bb,size=0; vector<int> a; while (cin >> aa >> bb&&aa != 0 && bb != 0) { if (aa > size || bb > size) { a.resize(max(aa, bb) - a.size()); fill_n(&a + size, max(aa, bb) - size, 0); size = a.size(); } a[aa - 1] += 1; a[bb - 1] += 1; } if (a[0] % 2 == 1 && a[1] % 2 == 1 && judge(a,a.size()) == 0) output("OK"); else output("NG"); }
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: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = vector<int>*; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]': /usr/include/c++/14/bits/stl_algobase.h:998:21: required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = vector<int>*; _Tp = int]' 998 | { std::__fill_a1(__first, __last, __value); } | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1154:20: required from '_OutputIterator std::__fill_n_a(_OutputIterator, _Size, const _Tp&, random_access_iterator_tag) [with _OutputIterator = vector<int>*; _Size = int; _Tp = int]' 1154 | std::__fill_a(__first, __first + __n, __value); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1183:29: required from '_OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = vector<int>*; _Size = int; _Tp = int]' 1183 | return std::__fill_n_a(__first, std::__size_to_integer(__n), __value, | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1184 | std::__iterator_category(__first)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:26:10: required from here 26 | fill_n(&a + size, max(aa, bb) - size, 0); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:952:18: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'const int') 952 | *__first = __tmp; | ~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/vector:72, from a.cc:2: /usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]' 210 | vector<_Tp, _Alloc>:: | ^~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/vector.tcc:211:42: note: no known conversion for argument 1 from 'const int' to 'const std::vector<int>&' 211 | operator=(const vector<_Tp, _Alloc>& __x) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66: /usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:766:26: note: no known conversion for argument 1 from 'const int' to 'std::vector<int>&&' 766 | operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) | ~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]' 788 | operator=(initializer_list<value_type> __l) | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:788:46: note: no known conversion for argument 1 from 'const int' to 'std::initializer_list<int>' 788 | operator=(initializer_list<value_type> __l) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
s869445071
p00086
C++
#include <iostream> using namespace std; int main(){ int a, b, v[101], p; while(cin >> a && cin >> b){ v[a]++; v[b]++; if(a == 0);{ for (int i = 3; i <= 100; i++){ if (v[i]%2 == 1){ p = 1; } } if (p == 1) cout << "NG" << endl; else cout << "OK" << endl; v[] = {}; p = 0; } } }
a.cc: In function 'int main()': a.cc:19:27: error: expected primary-expression before ']' token 19 | v[] = {}; | ^
s809931489
p00086
C++
#include<cstdio> #include<string> #include<algorithm> using namespace std; int n, m, s, t = 0; int d[110][110], used[110]; /*v????????¨??°???t????¨?????????????????????°*/ bool solve(int v,int count) { if (used[v] == 0) { used[v] == 1; count++; } if (d[v][2] > 0 && count == t - 1)return true; for (int u = 3; u <= t; u++) { if (v <= u&&d[v][u]>0) { d[v][u]--; if (solve(u, count)) return true; } else if (v > u&&d[u][v] > 0 ) { d[u][v]--; if (solve(u, count))return true; } } return false; } int main() { for (int i = 0; i < 110; i++) { used[110] = 0; for (int j = 0; j < 110; j++) { d[i][j] = 0; } } while (scanf_s("%d %d", &n, &m)) { if (n == 0 && m == 0)break; s = max(n, m); t = max(t, s); d[min(n, m)][s]++; } if (solve(1,1))printf("OK\n"); else printf("NG\n"); }
a.cc: In function 'int main()': a.cc:32:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 32 | while (scanf_s("%d %d", &n, &m)) { | ^~~~~~~ | scanf
s640852524
p00086
C++
#include<cstdio> #include<string> #include<algorithm> using namespace std; int n, m, s, t = 0; int d[110][110], used[110]; /*v????????¨??°???t????¨?????????????????????°*/ bool solve(int v,int count) { if (used[v] == 0) { used[v] == 1; count++; } printf("%d", v); if (d[2][v] > 0 || d[v][2] > 0 && count == t - 1)return true; for (int u = 3; u <= t; u++) { if (v <= u&&d[v][u]>0) { d[v][u]--; if (solve(u, count)) return true; } else if (v > u&&d[u][v] > 0 ) { d[u][v]--; if (solve(u, count))return true; } } return false; } int main() { for (int i = 0; i < 110; i++) { used[110] = 0; for (int j = 0; j < 110; j++) { d[i][j] = 0; } } while (scanf_s("%d %d", &n, &m)) { if (n == 0 && m == 0)break; s = max(n, m); t = max(t, s); d[min(n, m)][s]++; } if (solve(1,1))printf("OK\n"); else printf("NG\n"); }
a.cc: In function 'int main()': a.cc:33:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 33 | while (scanf_s("%d %d", &n, &m)) { | ^~~~~~~ | scanf