submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s523512780
p03992
C++
#include <iostream> #include <string> using namespace std; int main(){ string words; cin >> string; for (int i = 0; i < 12; ++i) { cout << string[i]; if (i == 3) { cout << " "; } } cout << endl; }
a.cc: In function 'int main()': a.cc:7:22: error: expected primary-expression before ';' token 7 | cin >> string; | ^ a.cc:10:31: error: expected primary-expression before '[' token 10 | cout << string[i]; | ^
s211582426
p03992
C++
#include <iostream> #include <string> using namespace std; int main(){ string words; cin >> string; for (int i = 0; i < 12; ++i) { cout << string[i] if (i == 3) { cout << " " ; } } cout << endl; }
a.cc: In function 'int main()': a.cc:7:22: error: expected primary-expression before ';' token 7 | cin >> string; | ^ a.cc:10:31: error: expected primary-expression before '[' token 10 | cout << string[i] | ^
s305782395
p03992
C
#inlcude<stdio.h> int main() { char s[13],s1[13]; scanf("%4s%8s",s,s1); printf("%s %s\n",s,s1); }
main.c:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude<stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%4s%8s",s,s1); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #inlcude<stdio.h> main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%4s%8s",s,s1); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 6 | printf("%s %s\n",s,s1); | ^~~~~~ main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:6:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s880696585
p03992
C
#inlcude<stdio.h> int main() { char s[13],s1[13]; scanf("%4s%8s",s,s1); printf("%s %s\n",s,s1); return 0; }
main.c:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude<stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%4s%8s",s,s1); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #inlcude<stdio.h> main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%4s%8s",s,s1); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 6 | printf("%s %s\n",s,s1); | ^~~~~~ main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:6:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s787005306
p03992
C
#inlcude<stdio.h> int main() { char s[13],s1[13]; scanf("%4s%8s",s,s1); printf("%s %s",s,s1); }
main.c:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude<stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%4s%8s",s,s1); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #inlcude<stdio.h> main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%4s%8s",s,s1); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 6 | printf("%s %s",s,s1); | ^~~~~~ main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:6:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s211233846
p03992
C++
#inlcude<stdio.h> int main() { char s[13],s1[13]; scanf("%4s%8s",s,s1); printf("%s %s",s,s1); }
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude<stdio.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:5:9: error: 'scanf' was not declared in this scope 5 | scanf("%4s%8s",s,s1); | ^~~~~ a.cc:6:9: error: 'printf' was not declared in this scope 6 | printf("%s %s",s,s1); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | #inlcude<stdio.h>
s334454659
p03992
C++
#include<iostream> #define rep(i,a,b) for(int i=a;i<b;i++) using namespace std; int main() { char s[13]; cin >> s; int count = 0; rep(i, 0, 13) { if(i!=4) cout << s[count++]; else cout << " "; } cout << endl; return; }
a.cc: In function 'int main()': a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 15 | return; | ^~~~~~
s873933481
p03992
C++
#include<iostream> #define rep(i,a,b) for(int i=a;i<b;i++) using namespace std int main() { char s[13]; cin >> s; int count = 0; rep(i, 0, 13) { if(i!=4) cout << s[count++]; else cout << " "; } cout << endl; return; }
a.cc:3:20: error: expected ';' before 'int' 3 | using namespace std | ^ | ; 4 | 5 | int main() { | ~~~ a.cc: In function 'int main()': a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 15 | return; | ^~~~~~
s927819464
p03992
C++
#include<iostream> #define rep(i,a,b) for(i=a;i<b;i++) using namespace std int main() { char s[13]; cin >> s; int count = 0; rep(i, 0, 13) { if(i!=4) cout << s[count++]; else cout << " "; } cout << endl; return; }
a.cc:3:20: error: expected ';' before 'int' 3 | using namespace std | ^ | ; 4 | 5 | int main() { | ~~~ a.cc: In function 'int main()': a.cc:9:13: error: 'i' was not declared in this scope 9 | rep(i, 0, 13) { | ^ a.cc:2:24: note: in definition of macro 'rep' 2 | #define rep(i,a,b) for(i=a;i<b;i++) | ^ a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 15 | return; | ^~~~~~
s728796394
p03992
C++
s=input() print(s[:4]+" "+s[4:])
a.cc:1:1: error: 's' does not name a type 1 | s=input() | ^
s211549139
p03992
C
//# include <stdio.h> //# include <iostream> # include <cstdio> //# include <conio.h> //using namespace std; int main () { char s [20]; // cin >> s; int x = scanf ("%s", s); for ( int i=0; i < 4; i++ ) // cout << s [i]; printf ("%c", s [i]); // cout << " "; printf (" "); for ( int i=4; i < 12; i++ ) // cout << s [i]; printf ("%c", s [i]); //getch(); return 0; }
main.c:3:11: fatal error: cstdio: No such file or directory 3 | # include <cstdio> | ^~~~~~~~ compilation terminated.
s541878757
p03992
C++
# include <iostream> using namespace std; int Main () { char s [20]; cin >> s; for ( int i=0; i < 4; i++ ) cout << s [i]; cout << " "; for ( int i=4; i < 12; i++ ) cout << s [i]; return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s543581027
p03992
C++
#include <stdio.h> #include <string.h> int main() { char a[12]; gets(a); for(int i=0;i<4;i++) printf("%c",a[i]); printf(" "); for(int i=4;i<12;i++) printf("%c",a[i]); return 0; }
a.cc: In function 'int main()': a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(a); | ^~~~ | getw
s851709051
p03992
Java
public class Main { public static main(String[] args) { Scanner s = new Scanner(System.in); if(s.hasNext()) { String input = s.next(); System.out.println(input.substring(0, 3) + " " + input.substring(4)); } } }
Main.java:2: error: invalid method declaration; return type required public static main(String[] args) { ^ 1 error
s634689295
p03992
C++
#include <iostream> #include <cmath> #include <stdio.h> #include <algorithm> using namespace std; int main() { char a[12]; gets(a); for(int i=0;i<4;i++) printf("%c",a[i]); printf(" "); for(int i=4;i<12;i++) printf("%c",a[i]); return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(a); | ^~~~ | getw
s307083122
p03992
C++
#include <iostream> #include <stdio.h> #include <cstdio>. using namespace std; int main(){ char s[20]; gets(s); string strS; strS.append(s); string result = strS.substr(0,4) + string(" ") + strS.substr(4,11); printf("%s", result.c_str()); return 0; }
a.cc:3:18: warning: extra tokens at end of #include directive 3 | #include <cstdio>. | ^ a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s015814517
p03992
C++
#include <iostream> #include <stdio.h> using namespace std; int main(){ char s[20]; gets(s); string strS; strS.append(s); string result = strS.substr(0,4) + string(" ") + strS.substr(4,11); printf("%s", result.c_str()); return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s623796125
p03992
C++
#include <iostream> #include <stdio.h> using namespace std; int main(int argc, char **argv){ char s[20]; gets(s); string strS; strS.append(s); string result = strS.substr(0,4) + string(" ") + strS.substr(4,11); printf("%s", result.c_str()); return 0; }
a.cc: In function 'int main(int, char**)': a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | gets(s); | ^~~~ | getw
s786208093
p03992
C++
#include <iostream> #include <stdio.h> using namespace std; int main(int argc, char **argv){ char s[20]; gets_s(s); string strS; strS.append(s); string result = strS.substr(0,4) + string(" ") + strS.substr(4,11); printf("%s", result.c_str()); return 0; }
a.cc: In function 'int main(int, char**)': a.cc:6:9: error: 'gets_s' was not declared in this scope 6 | gets_s(s); | ^~~~~~
s582752214
p03992
C++
#include<iostream> #include<string> using namespace std; int main(){ string s; cin>>s; s.insert(4, “ “); cout<<s<<endl; return 0; }
a.cc:7:13: error: extended character “ is not valid in an identifier 7 | s.insert(4, “ “); | ^ a.cc:7:15: error: extended character “ is not valid in an identifier 7 | s.insert(4, “ “); | ^ a.cc: In function 'int main()': a.cc:7:13: error: '\U0000201c' was not declared in this scope 7 | s.insert(4, “ “); | ^
s323548896
p03992
C++
#include<iostream> #include<conio.h> #include<string> using namespace std; int main(){ string s; cin>>s; s.insert(4, “ “); cout<<s<<endl; return 0; }
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s166699127
p03992
Java
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { public static void main (String[] args) throws java.lang.Exception { String ret = ""; while(true){ ret += System.in.read(); } System.out.println(ret); } }
Main.java:16: error: unreachable statement System.out.println(ret); ^ 1 error
s927543984
p03992
C++
#include<iostream> #include<conio.h> #include<string> using namespace std; int main(){ string s=”CODEFESTIVAL”; s.insert(4, “ “); cout<<s; getch() return 0; }
a.cc:2:9: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s147403390
p03992
C++
#include<iostream> #include<cstring> using namespace std; int main(){ char S[12]; cout<<”Enter string:” << endl; cin.getline(S,12); Char* point; point=strtok(S, “.”); while(point!=NULL){ cout<<point<<endl; point=strtok(NULL,”.”); } Retrun 0; }
a.cc:6:7: error: extended character ” is not valid in an identifier 6 | cout<<”Enter string:” << endl; | ^ a.cc:6:21: error: extended character ” is not valid in an identifier 6 | cout<<”Enter string:” << endl; | ^ a.cc:9:17: error: extended character “ is not valid in an identifier 9 | point=strtok(S, “.”); | ^ a.cc:9:19: error: extended character ” is not valid in an identifier 9 | point=strtok(S, “.”); | ^ a.cc:12:19: error: extended character ” is not valid in an identifier 12 | point=strtok(NULL,”.”); | ^ a.cc:12:21: error: extended character ” is not valid in an identifier 12 | point=strtok(NULL,”.”); | ^ a.cc: In function 'int main()': a.cc:6:7: error: '\U0000201dEnter' was not declared in this scope 6 | cout<<”Enter string:” << endl; | ^~~~~~ a.cc:8:1: error: 'Char' was not declared in this scope; did you mean 'char'? 8 | Char* point; | ^~~~ | char a.cc:8:7: error: 'point' was not declared in this scope 8 | Char* point; | ^~~~~ a.cc:9:17: error: '\U0000201c' was not declared in this scope 9 | point=strtok(S, “.”); | ^ a.cc:12:19: error: '\U0000201d' was not declared in this scope 12 | point=strtok(NULL,”.”); | ^ a.cc:14:1: error: 'Retrun' was not declared in this scope 14 | Retrun 0; | ^~~~~~
s856955706
p03992
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // get a integer int a = sc.nextInt(); if (a == 1) return 0; // get two integers separated with half-width break int[] b = new int[a]; try { for (int i = 0; i < a; i++) { b[i] = sc.nextInt(); } } catch (Exception e) { ; } int count = 0; for (int i = 0; i < a/2; i++) { if (b[b[i]-1] == i+1 && b[i] != (i+1)) count++; } System.out.println(count); } }
Main.java:8: error: incompatible types: unexpected return value return 0; ^ 1 error
s278814125
p03992
C++
#include <iostream> #include <string> using namespace std; int main(){ int number; cin >> number; string tmp; cin >> tmp; int likes[number]; char* pch; pch = strtok (tmp.c_str()," "); int pos = 0; while(pch != NULL){ likes[pos] = atoi(pch); pch = strtok (tmp.c_str()," "); pos++; } int pairs = 0; for(int i = 0; i < number; i++){ int r1 = i+1; int r1_likes = likes[i]; int r2_likes = likes[r1_likes*2]; if(r1 == r2_likes) pairs++; } cout << pairs << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:11: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 18 | pch = strtok (tmp.c_str()," "); | ^~~~~~ | strtoq
s005540483
p03992
C++
#include <iostream> #include <string> using namespace std; int main(){ int number; cin >> number; string tmp; cin >> tmp; int likes[number]; char* pch; pch = strtok (tmp.c_str()," "); int pos = 0; while(pch != null){ likes[pos] = atoi(pch); pch = strtok (tmp.c_str()," "); pos++; } int pairs = 0; for(int i = 0; i < number; i++){ int r1 = i+1; int r1_likes = likes[i]; int r2_likes = likes[r1_likes*2]; if(r1 == r2_likes) pairs++; } cout << pairs << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:11: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 17 | pch = strtok (tmp.c_str()," "); | ^~~~~~ | strtoq a.cc:19:18: error: 'null' was not declared in this scope 19 | while(pch != null){ | ^~~~
s707538082
p03992
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ char s[14];int i=0; scanf("%s", str); for(i=12;i>3;i--){ s[i]=s[i-1]; } s[3]=' '; printf("%s",s); return 0; }
main.c: In function 'main': main.c:7:21: error: 'str' undeclared (first use in this function) 7 | scanf("%s", str); | ^~~ main.c:7:21: note: each undeclared identifier is reported only once for each function it appears in
s412282379
p03992
C++
#include<stdio.h> using namespace std; int main(){ char s[11]; scanf( "%c, &s[]"); int i; for( i= 0; i< 3; i++){ printf( "%c, s[i]"); } printf( " "); while( 5<= i){ if( 11< i) break; else{ i++; printf( "%c, s[i]"); } printf( \n); } return 0; }
a.cc:31:17: error: stray '\' in program 31 | printf( \n); | ^ a.cc: In function 'int main()': a.cc:31:18: error: 'n' was not declared in this scope 31 | printf( \n); | ^
s881389236
p03992
C++
#include<iostream> using namespace std; int main() { string s; cin >> s; cout << st[0] << st[1] << st[2] << st[3] << " " << st[4] << st[5] << st[6] << st[[7] << st[8] << st[9] << st[10] << st[11] ; return 0; }
a.cc: In function 'int main()': a.cc:8:13: error: 'st' was not declared in this scope; did you mean 's'? 8 | cout << st[0] << st[1] << st[2] << st[3] << " " << st[4] << st[5] << st[6] << st[[7] << st[8] << st[9] << st[10] << st[11] ; | ^~ | s a.cc:8:85: error: two consecutive '[' shall only introduce an attribute before '[' token 8 | cout << st[0] << st[1] << st[2] << st[3] << " " << st[4] << st[5] << st[6] << st[[7] << st[8] << st[9] << st[10] << st[11] ; | ^
s328339148
p03992
Java
import java.util.Scanner; public class main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String str = sc.nextLine(); char[] str_a = str.toCharArray(); boolean flag = true; char[] str_1 = new char[4]; char[] str_2 = new char[str.length()-4-1]; for (int i=0;i<4;i++){ str_1[i] = str_a[i]; } for (int i=4;i<str_a.length-1;i++){ str_2[i-4] = str_a[i]; } String a = new String(str_1); String b = new String(str_2); String c = a+' '+b+'\n'; System.out.println(c); } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s775266077
p03992
C++
#include <iostream> using namespace std; int Main() { string st; cin >> st; for ( int i = 0; i < 3; i ++ ) cout << st[i]; cout << " "; for ( int i = 3; i < st.length(); i ++ ) cout << st[i]; return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s137354916
p03992
Java
import java.util.Scanner; public class main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String str = sc.nextLine(); char[] str_a = str.toCharArray(); boolean flag = true; char[] str_1 = new char[4]; char[] str_2 = new char[str.length()-4]; for (int i=0;i<4;i++){ str_1[i] = str_a[i]; } for (int i=4;i<str_a.length;i++){ str_2[i-4] = str_a[i]; } String a = new String(str_1); String b = new String(str_2); String c = a+' '+b+'\n'; System.out.println(c); } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s885852554
p03992
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> int main(){ char ary1[14]; char ary2[14]; char ary3[14]; int i=0; scanf("%s",ary1); for(i=0;i<4;i++) ary3[i]=ary1[i]; for(i=0;i<8;i++) ary2[i]=ary1[4+i]; strcat(ary3," "); strcat(ary3,ary2); printf("%s/n",art3); return 0; }
main.c: In function 'main': main.c:15:15: error: 'art3' undeclared (first use in this function); did you mean 'ary3'? 15 | printf("%s/n",art3); | ^~~~ | ary3 main.c:15:15: note: each undeclared identifier is reported only once for each function it appears in
s063964451
p03992
C++
#include<iostream>; using namespace std; int main(){ char s[11]; scanf( %s, s[]); int i; for( i= 0; i< 3; i++){ printf( %s, s[i]); } printf( " "); while( 5=< i){ i++; printf( %s, s[i]); if( 11< i) break; } return 0; }
a.cc:1:19: warning: extra tokens at end of #include directive 1 | #include<iostream>; | ^ a.cc: In function 'int main()': a.cc:9:16: error: expected primary-expression before '%' token 9 | scanf( %s, s[]); | ^ a.cc:9:22: error: expected primary-expression before ']' token 9 | scanf( %s, s[]); | ^ a.cc:15:25: error: expected primary-expression before '%' token 15 | printf( %s, s[i]); | ^ a.cc:21:18: error: expected primary-expression before '<' token 21 | while( 5=< i){ | ^ a.cc:25:25: error: expected primary-expression before '%' token 25 | printf( %s, s[i]); | ^
s577723308
p03992
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> int main(){ char ary1[14]; char ary2[14]; char ary3[14]; int i=0; scanf_s("%s",ary1); for(i=0;i<4;i++) ary3[i]=ary1[i]; for(i=0;i<8;i++) ary2[i]=ary1[4+i]; strcat(ary3," "); strcat(art3,ary2); printf("%s/n",art3); return 0; }
main.c: In function 'main': main.c:10:1: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 10 | scanf_s("%s",ary1); | ^~~~~~~ | scanf main.c:14:8: error: 'art3' undeclared (first use in this function); did you mean 'ary3'? 14 | strcat(art3,ary2); | ^~~~ | ary3 main.c:14:8: note: each undeclared identifier is reported only once for each function it appears in
s629148344
p03992
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <strong.h> int main(){ char ary1[14]; char ary2[14]; char ary3[14]; int i=0; scanf_s("%s",ary1); for(i=0;i<4;i++) ary3[i]=ary1[i]; for(i=0;i<8;i++) ary2[i]=ary1[4+i]; strcat(ary3," "); strcat(art3,ary2); printf("%s/n",art3); return 0; }
main.c:3:10: fatal error: strong.h: No such file or directory 3 | #include <strong.h> | ^~~~~~~~~~ compilation terminated.
s371251712
p03992
C
#include <stdio.h> #include <stdio.h> int main(){ char ary1[14]; char ary2[14]; char ary3[14]; int i=0; scanf_s("%s",ary1); for(i=0;i<4;i++) ary3[i]=ary1[i]; for(i=0;i<8;i++) ary2[i]=ary1[4+i]; strcat(ary3," "); strcat(art3,ary2); printf("%s/n",art3); return 0; }
main.c: In function 'main': main.c:9:1: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 9 | scanf_s("%s",ary1); | ^~~~~~~ | scanf main.c:12:1: error: implicit declaration of function 'strcat' [-Wimplicit-function-declaration] 12 | strcat(ary3," "); | ^~~~~~ main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcat' 1 | #include <stdio.h> +++ |+#include <string.h> 2 | #include <stdio.h> main.c:12:1: warning: incompatible implicit declaration of built-in function 'strcat' [-Wbuiltin-declaration-mismatch] 12 | strcat(ary3," "); | ^~~~~~ main.c:12:1: note: include '<string.h>' or provide a declaration of 'strcat' main.c:13:8: error: 'art3' undeclared (first use in this function); did you mean 'ary3'? 13 | strcat(art3,ary2); | ^~~~ | ary3 main.c:13:8: note: each undeclared identifier is reported only once for each function it appears in
s895514817
p03992
Java
import java.util.Scanner; public class main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); String str = sc.nextLine(); // String str = "CODEFESTIVel"; String n = " "; if (str.length()==12){ System.out.println(); char[] str_a = str.toCharArray(); boolean flag = true; char[] str_1 = new char[4]; char[] str_2 = new char[str.length()-4]; for (int i=1;i<str_a.length;i++){ if (str_a[i]>=55 && str_a[i]<=90){ flag = true; } else{ flag = false; break; } } if(flag == true){ for (int i=0;i<4;i++){ str_1[i] = str_a[i]; } for (int i=4;i<str_a.length;i++){ str_2[i-4] = str_a[i]; } String a = new String(str_1); String b = new String(str_2); String c = a+" "+b+'\0'; System.out.println(c); } else{ System.out.println(str);} } else{ System.out.println(str);} } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s238445304
p03992
C
#include <stdio.h> #include <iostream> #include <cstdio> using namespace std; int main(void) { char s[13]; scanf("%s",s); printf("%c%c%c%c %c%c%c%c%c%c%c%c\n",s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],s[10],s[11]); return 0; }
main.c:2:10: fatal error: iostream: No such file or directory 2 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s110109360
p03992
C++
#include <stdio.h> int main(void){ char buf[25]; scanf("%s",buf); char temp; for(int i=0;i<25;i++){ if(4==i){ temp=buf[i]; buf[i]=" "; }else if(4 < i){ int t=buf[i]; buf[i] = temp; temp=t; } } printf(buf); }
a.cc: In function 'int main()': a.cc:11:20: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 11 | buf[i]=" "; | ^~~ | | | const char*
s785088007
p03992
Java
public class Main { public String A(String str) { char[] str_a = str.toCharArray(); boolean flag = true; char[] str_1 = new char[4]; char[] str_2 = new char[8]; for (int i=0;i<4;i++){ str_1[i] = str_a[i]; } for (int i=4;i<str_a.length;i++){ str_2[i-4] = str_a[i]; } String a = new String(str_1); String b = new String(str_2); String c = a+" "+b; return c; } } }
Main.java:23: error: class, interface, enum, or record expected } ^ 1 error
s724415569
p03992
C++
#include <iostream> #include <istream> #include <string> using namespace std; int main(){ string src; int pos = 0; cin >> src; string rst(src.length()+2, ''); for(int i = 0; i < src.length() + 2; i++){ if(i == 4){ rst[i] = ' '; } else{ rst[i] = src[i]; pos++; } } printf("%s", rst); return 0; }
a.cc:13:32: error: empty character constant 13 | string rst(src.length()+2, ''); | ^~
s517451556
p03992
Java
public class Solution { public String A(String str) { if (str.length()==12){ char[] str_a = str.toCharArray(); boolean flag = true; char[] str_1 = new char[4]; char[] str_2 = new char[8]; for (int i=1;i<str_a.length;i++){ if (str_a[i]>=55 && str_a[i]<=90){ flag = true; } else{ flag = false; break; } } if(flag == true){ for (int i=0;i<4;i++){ str_1[i] = str_a[i]; } for (int i=4;i<str_a.length;i++){ str_2[i-4] = str_a[i]; } String a = new String(str_1); String b = new String(str_2); String c = a+" "+b; return c; } else{ return null; } } else { return null; } } }
Main.java:1: error: class Solution is public, should be declared in a file named Solution.java public class Solution { ^ 1 error
s418570238
p03992
Java
package testA; public class main { public static void main(String[] args) { // TODO Auto-generated method stub String str = "CODEFESTIVEL"; if (str.length()==12){ System.out.println(); char[] str_a = str.toCharArray(); boolean flag = true; char[] str_1 = new char[4]; char[] str_2 = new char[8]; for (int i=1;i<str_a.length;i++){ if (str_a[i]>=55 && str_a[i]<=90){ flag = true; } else{ flag = false; break; } } if(flag == true){ for (int i=0;i<4;i++){ str_1[i] = str_a[i]; } for (int i=4;i<str_a.length;i++){ str_2[i-4] = str_a[i]; } String a = new String(str_1); String b = new String(str_2); String c = a+" "+b; System.out.println(c); } //System.out.println(a+" "+b); } } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s803163346
p03992
Java
package testA; public class Solution { public String A(String s) { if (str.length()==12){ char[] str_a = str.toCharArray(); boolean flag = true; char[] str_1 = new char[4]; char[] str_2 = new char[8]; for (int i=1;i<str_a.length;i++){ if (str_a[i]>=55 && str_a[i]<=90){ flag = true; } else{ flag = false; break; } } if(flag == true){ for (int i=0;i<4;i++){ str_1[i] = str_a[i]; } for (int i=4;i<str_a.length;i++){ str_2[i-4] = str_a[i]; } String a = new String(str_1); String b = new String(str_2); String c = a+" "+b; return c; } else{ return null; } } else { return null; } } }
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java public class Solution { ^ Main.java:5: error: cannot find symbol if (str.length()==12){ ^ symbol: variable str location: class Solution Main.java:6: error: cannot find symbol char[] str_a = str.toCharArray(); ^ symbol: variable str location: class Solution 3 errors
s930505970
p03992
C++
#include <iostream> #include <istream> #include <string> using namespace std; void main(){ string str; cin >> str ; string rst(str.length(), ''); int pos = 0; for(int i = 0; i < rst.length(); i++){ if(i == 4){ rst[i] = ' '; } else{ rst[i] = str[pos]; pos++; } } cout << rst << endl; }
a.cc:10:30: error: empty character constant 10 | string rst(str.length(), ''); | ^~ a.cc:7:1: error: '::main' must return 'int' 7 | void main(){ | ^~~~
s389790540
p03992
C++
#include <bits/stdc++.h> using namespace std; const int N=1e5+5; int v[N]; int main(int argc, char const *argv[]) { /* code */ while (cin>>n){ for (int i=1;i<=n;i++) scanf("%d",v+i); int ans=0; for (int i=1;i<=n;i++){ int t=v[i]; if (v[t]==i) ans++; } cout<<ans/2<<endl; } return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:10:21: error: 'n' was not declared in this scope 10 | while (cin>>n){ | ^
s740768405
p03992
Java
public class Solution { public String A(String s) { if (str.length()==12){ char[] str_a = str.toCharArray(); boolean flag = true; char[] str_1 = new char[4]; char[] str_2 = new char[8]; for (int i=1;i<str_a.length;i++){ if (str_a[i]>=55 && str_a[i]<=90){ flag = true; } else{ flag = false; break; } } if(flag == true){ for (int i=0;i<4;i++){ str_1[i] = str_a[i]; } for (int i=4;i<str_a.length;i++){ str_2[i-4] = str_a[i]; } String a = new String(str_1); String b = new String(str_2); String c = a+" "+b; return c; } else{ return null; } } else { return null; } } }
Main.java:1: error: class Solution is public, should be declared in a file named Solution.java public class Solution { ^ Main.java:3: error: cannot find symbol if (str.length()==12){ ^ symbol: variable str location: class Solution Main.java:4: error: cannot find symbol char[] str_a = str.toCharArray(); ^ symbol: variable str location: class Solution 3 errors
s010678446
p03992
Java
public class Solution { public String A(String s) { if (str.length()==12){ char[] str_a = str.toCharArray(); boolean flag = true; char[] str_1 = new char[4]; char[] str_2 = new char[8]; for (int i=1;i<str_a.length;i++){ if (str_a[i]>=55 && str_a[i]<=90){ flag = true; } else{ flag = false; break; } } if(flag == true){ for (int i=0;i<4;i++){ str_1[i] = str_a[i]; } for (int i=4;i<str_a.length;i++){ str_2[i-4] = str_a[i]; } String a = new String(str_1); String b = new String(str_2); String c = a+" "+b; return c } else{ return null; } } else { return null; } } }
Main.java:28: error: ';' expected return c ^ 1 error
s583426768
p03992
C++
#include <algorithm> #include <cstdio> #include <map> using namespace std; typedef long long ll; char s[10]; int main() { gets(s); for (int i = 0; i < 12; i++) { if (i == 4) putchar(' '); putchar(s[i]); } putchar('\n'); }
a.cc: In function 'int main()': a.cc:12:3: error: 'gets' was not declared in this scope; did you mean 'getw'? 12 | gets(s); | ^~~~ | getw
s994794745
p03992
Java
public class Mainl { public static void main(String[] args) { String str = System.console().readLine(); String strFirst = str.substring(0, 4); String strLast = str.substring(4); str = strFirst + " " + strLast + "\n"; System.out.print(str); } }
Main.java:2: error: class Mainl is public, should be declared in a file named Mainl.java public class Mainl { ^ 1 error
s828109139
p03992
C++
#include <algorithm> #include <cstdio> #include <map> using namespace std; typedef long long ll; char s[10]; int main() { gets(s); for (int i = 0; i < 12; i++) { if (i == 4) putchar(' '); putchar(s[i]); } }
a.cc: In function 'int main()': a.cc:12:3: error: 'gets' was not declared in this scope; did you mean 'getw'? 12 | gets(s); | ^~~~ | getw
s363632151
p03992
Java
import java.util.*; public class Contest { public static void main(String[] args) { Scanner sc = new Scanner(System.in); sc.next(); String code = sc.next(); StringBuffer sb = new StringBuffer(); char[] m = code.toCharArray(); for (int i = 0; i < m.length; i++){ sb.append(m[i]); if (i == 3){ sb.append(" "); } } System.out.println(sb); } }
Main.java:3: error: class Contest is public, should be declared in a file named Contest.java public class Contest { ^ 1 error
s123611903
p03992
C
#include <stdio.h> #include <string.h> mian(){ char ary1[100]; char ary2[100]; char ary3[100]; int i=0; //fgets(ary1,sizeof(char)*15,stdin); scanf("%s",ary1); while(i<4){ ary2[i]=ary1[i]; i++; } while(i<8){ ary3[i]=ary1[i+4]; i++; } strcat(ary2," "); strcat(ary2,ary3); printf("%s\n",ary2); return 0; }
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int] 4 | mian(){ | ^~~~
s773534115
p03992
C++
#include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <set> #include <functional> #include <map> #include <queue> #include <cmath> #include <string> #include <stack> using namespace std; int main(void){ string str; cin >> str; cout << str.substr(0,4) << " " << str.substr(4,8); return 0; }
a.cc: In function 'int main()': a.cc:16:1: error: 'cin' was not declared in this scope 16 | cin >> str; | ^~~ a.cc:13:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 12 | #include <stack> +++ |+#include <iostream> 13 | using namespace std; a.cc:17:1: error: 'cout' was not declared in this scope 17 | cout << str.substr(0,4) << " " << str.substr(4,8); | ^~~~ a.cc:17:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s541834060
p03992
C
#include <stdio.h> #include <string.h> int mian(){ char ary1[100]; char ary2[100]; char ary3[100]; int i=0; //fgets(ary1,sizeof(char)*15,stdin); scanf("%s",ary1); while(i<4){ ary2[i]=ary1[i]; i++; } while(i<8){ ary3[i]=ary1[i+4]; i++; } strcat(ary2," "); strcat(ary2,ary3); printf("%s\n",ary2); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s560829554
p03992
C++
#include <iostream> #include <vector> template<typename type> std::vector<type>&& input_value(std::istream& ist) { type buffer; std::vector<type> ret; while (ist >> buffer) { ret.push_back(buffer); } return ret; } int main() { int count{ 0 }; std::vector<int> rabbits{ input_value<int>(std::cin) }; for (auto i{ 0 }; i < rabbits.size(); ++i) { if (i == rabbits.at(rabbits.at(i))) ++count; } std::cout << count << std::endl; }
a.cc: In instantiation of 'std::vector<type>&& input_value(std::istream&) [with type = int; std::istream = std::basic_istream<char>]': a.cc:20:44: required from here 20 | std::vector<int> rabbits{ input_value<int>(std::cin) }; | ~~~~~~~~~~~~~~~~^~~~~~~~~~ a.cc:14:16: error: cannot bind rvalue reference of type 'std::vector<int>&&' to lvalue of type 'std::vector<int>' 14 | return ret; | ^~~
s076508792
p03992
C++
#include <string> using namespace std; string insertSpace(string s){ string res = s.insert(4, " "); res = res.append("\n"); return res; };
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s610860813
p03992
C
#include <stdio.h> #include <string.h> int mian(){ char ary1[14]; char ary2[14]; char ary3[14]; int i=0; //fgets(ary1,sizeof(char)*15,stdin); scanf("%s",ary1); while(i<4){ ary2[i]=ary1[i]; i++; } while(i<8){ ary3[i]=ary1[i+4]; i++; } strcat(ary2," "); strcat(ary2,ary3); printf("%s\n",ary2); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s176779759
p03992
Java
import java.util.*; Public class Main{ public static void main(String [] args){ Scanner sc = new Scanner (System.in); String in = sc.next(); return in.substring(0,4) + " " + in.substring(4); } }
Main.java:3: error: class, interface, enum, or record expected Public class Main{ ^ 1 error
s836676374
p03992
Java
public class Codefestival { public static void main(String[] args) { String str = args[0]; String strFirst = str.substring(0, 4); String strLast = str.substring(4); str = strFirst + " " + strLast + "\n"; System.out.print(str); } }
Main.java:1: error: class Codefestival is public, should be declared in a file named Codefestival.java public class Codefestival { ^ 1 error
s759606114
p03992
C
#include <stdio.h> #include <string.h> int mian(){ char ary1[14]; char ary2[14]; char ary3[14]; int i; fgets(ary1,sizeof(char)*15,stdin); //scanf("%s",ary1); while(i<4) ary2[i]=ary1[i]; while(i<8) ary3[i]=ary1[i+4]; strcat(ary2," "); strcat(ary2,ary3); printf("%s\n",ary2); return 0; }
main.c: In function 'mian': main.c:9:1: warning: 'fgets' writing 15 bytes into a region of size 14 overflows the destination [-Wstringop-overflow=] 9 | fgets(ary1,sizeof(char)*15,stdin); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:5:6: note: destination object 'ary1' of size 14 5 | char ary1[14]; | ^~~~ In file included from main.c:1: /usr/include/stdio.h:654:14: note: in a call to function 'fgets' declared with attribute 'access (write_only, 1, 2)' 654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | ^~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s259103309
p03992
C++
s = raw_input() print s[:4] + ' ' + s[4:]
a.cc:1:1: error: 's' does not name a type 1 | s = raw_input() | ^
s567206381
p03992
Java
public class codefestival { public static void main(String[] args) { String str = args[0]; String strFirst = str.substring(0, 4); String strLast = str.substring(4); str = strFirst + " " + strLast + "\n"; System.out.print(str); } }
Main.java:2: error: class codefestival is public, should be declared in a file named codefestival.java public class codefestival { ^ 1 error
s044765678
p03992
C
#include <stdio.h> #include <string.h> int mian(){ char ary1[14]; char ary2[14]; char ary3[14]; int i; fgets(ary1,sizeof(char)*15,stdin); //scanf("%s",ary1); while(i<4) ary2[i]=ary1[i]; while(i<8) ary3[i]=ary1[i+4]; strcat(ary2," "); strcat(ary2,ary3); printf("%s\n",ary2); return 0; }
main.c: In function 'mian': main.c:9:1: warning: 'fgets' writing 15 bytes into a region of size 14 overflows the destination [-Wstringop-overflow=] 9 | fgets(ary1,sizeof(char)*15,stdin); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:5:6: note: destination object 'ary1' of size 14 5 | char ary1[14]; | ^~~~ In file included from main.c:1: /usr/include/stdio.h:654:14: note: in a call to function 'fgets' declared with attribute 'access (write_only, 1, 2)' 654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | ^~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s602071296
p03992
C++
#include <iostream> int main() { string s; cin >> s; cout << s.substr(0, 4) << " " << s.substr(4); return 0; }
a.cc: In function 'int main()': a.cc:4:4: error: 'string' was not declared in this scope 4 | string s; | ^~~~~~ a.cc:4:4: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included 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: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:5:4: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> s; | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:5:11: error: 's' was not declared in this scope 5 | cin >> s; | ^ a.cc:6:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 6 | cout << s.substr(0, 4) << " " << s.substr(4); | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s906104216
p03992
Java
public class Codefestival { public static void main(String[] args) { String str = args[0]; String strFirst = str.substring(0, 3); String strLast = str.substring(4); str = strFirst + " " + strLast + "\n"; System.out.print(str); } }
Main.java:1: error: class Codefestival is public, should be declared in a file named Codefestival.java public class Codefestival { ^ 1 error
s157536286
p03992
C
#include <stdio.h> #include <string.h> int mian(){ char ary1[14]; char ary2[14]; char ary3[14]; int i; scanf("%s",ary1); while(i<4) ary2[i]=ary1[i]; while(i<8) ary3[i]=ary1[i+4]; strcat(ary2," "); strcat(ary2,ary3); printf("%s\n",ary2); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s649345818
p03992
C++
#include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <set> #include <functional> #include <map> #include <queue> #include <cmath> #include <string> #include <stack> using namespace std; int main(void){ string str; scanf("%s",str); cout << str.substr(0,4) << " " << str.substr(4,8); return 0; }
a.cc: In function 'int main()': a.cc:17:1: error: 'cout' was not declared in this scope 17 | cout << str.substr(0,4) << " " << str.substr(4,8); | ^~~~ a.cc:13:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 12 | #include <stack> +++ |+#include <iostream> 13 | using namespace std;
s247229332
p03992
C
#include <stdlib.h> #include <stdio.h> int main (int argc, char *argv[]){ char string[12]; scanf(%s,&string); int i = 0; while (i<12){ if (i = 4) printf(" "); else { printf("%c",string[i]); i++; } } return 0; }
main.c: In function 'main': main.c:7:15: error: expected expression before '%' token 7 | scanf(%s,&string); | ^
s592001353
p03992
C
#include <stdio.h> #include <string.h> int mian(){ char ary1[14]; char ary2[14]; char ary3[14]; int i; scanf("%s",ary1); while(i<4) ary2[i]=ary1[i]; while(i<8) ary3[i]=ary1[i+4]; strcat(ary2," "); strcat(ary2,ary3); printf("%s\n",ary2); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s172004421
p03992
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String input = sc.nextLine(); System.out.println(question1(input)); } public static String question1(String input) { String result = input.substring(0, 4) + " " + input.substring(4); return result; } }
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s561617559
p03992
C
#include <stdlib.h> #include <stdio.h> int main (int argc, char *argv[]){ char* string[12]; scanf(%s,&string); int i = 0; while (i<12){ if (i = 4) printf(" "); else { printf("%c",&string[i]); i++; } } return 0; }
main.c: In function 'main': main.c:7:15: error: expected expression before '%' token 7 | scanf(%s,&string); | ^
s537455410
p03992
C
#include <stdlib.h> #include <stdio.h> int main (int argc, char *argv[]){ char* string[12]; scanf(%s,&string); int i = 0; while (i<12){ if (i = 4) printf(" "); else { printf("%c",string[i]); i++; } } return 0; }
main.c: In function 'main': main.c:7:15: error: expected expression before '%' token 7 | scanf(%s,&string); | ^
s040862809
p03992
C
string s1, s2; s1=LOVE; s2=EASTASIA; printf("%s%s\n","%s %s",s1,s2,s1,s2); return 0;
main.c:1:1: error: unknown type name 'string' 1 | string s1, s2; | ^~~~~~ main.c:2:1: warning: data definition has no type or storage class 2 | s1=LOVE; | ^~ main.c:2:1: error: type defaults to 'int' in declaration of 's1' [-Wimplicit-int] main.c:2:4: error: 'LOVE' undeclared here (not in a function) 2 | s1=LOVE; | ^~~~ main.c:3:1: warning: data definition has no type or storage class 3 | s2=EASTASIA; | ^~ main.c:3:1: error: type defaults to 'int' in declaration of 's2' [-Wimplicit-int] main.c:3:4: error: 'EASTASIA' undeclared here (not in a function) 3 | s2=EASTASIA; | ^~~~~~~~ main.c:4:8: error: expected declaration specifiers or '...' before string constant 4 | printf("%s%s\n","%s %s",s1,s2,s1,s2); | ^~~~~~~~ main.c:4:17: error: expected declaration specifiers or '...' before string constant 4 | printf("%s%s\n","%s %s",s1,s2,s1,s2); | ^~~~~~~ main.c:4:25: error: expected declaration specifiers or '...' before 's1' 4 | printf("%s%s\n","%s %s",s1,s2,s1,s2); | ^~ main.c:4:28: error: expected declaration specifiers or '...' before 's2' 4 | printf("%s%s\n","%s %s",s1,s2,s1,s2); | ^~ main.c:4:31: error: expected declaration specifiers or '...' before 's1' 4 | printf("%s%s\n","%s %s",s1,s2,s1,s2); | ^~ main.c:4:34: error: expected declaration specifiers or '...' before 's2' 4 | printf("%s%s\n","%s %s",s1,s2,s1,s2); | ^~ main.c:5:1: error: expected identifier or '(' before 'return' 5 | return 0; | ^~~~~~
s879499344
p03992
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string str; for (int i = 0; i < 12; ++i){ cin >> str; if(i==3){ cout << " "; } cout << str; } } return 0; }
a.cc:18:5: error: expected unqualified-id before 'return' 18 | return 0; | ^~~~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s515157186
p03992
C
#include <stdio.h> #include <string.h> int mian(){ char ary[14]; fgets(ary,sizeof(char)*4,stdin); strcat(ary," "); fgets(ary,sizeof(char)*8,stdin); printf("%s\n",ary); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s624088118
p03992
C++
#include <string> string insertSpace(string s){ string res = s.insert(4, " "); res = res.append("\n"); return res; }
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'? 2 | string insertSpace(string s){ | ^~~~~~ | stdin
s333214579
p03992
C++
#include <iostream> #include <string> using namespace std; void main() { char s[100]; string a; cin >> s; for (int i = 0; s[i] != '\0'; ++i) { if (i == 4) a = a + " "; a = a + s[i]; } cout << a; }
a.cc:5:1: error: '::main' must return 'int' 5 | void main() { | ^~~~
s083009726
p03992
C++
#include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <set> #include <functional> #include <map> #include <queue> #include <cmath> #include <string> #include <stack> #define SIZE 12 using namespace std; typedef long long int ll; typedef pair <int,int> int main(void){ string str; scanf("%s",str); cout << str.substr(1,4) << " " << str.substr(5,8); return 0; }
a.cc:16:9: error: two or more data types in declaration of 'main' 16 | typedef pair <int,int> | ^~~~~~~~~~~~~~
s197517560
p03992
C++
#include <iostream> #include <string> using namespace std; void main() { char s[100]; string a; cin >> s; for (int i = 0; s[i] != '\0'; ++i) { if (i == 4) a = a + " "; a = a + s[i]; } cout << a; }
a.cc:5:1: error: '::main' must return 'int' 5 | void main() { | ^~~~
s755005565
p03992
C++
string insertSpace(string s){ string res = s.insert(4, " "); res = res.append("\n"); return res; }
a.cc:1:1: error: 'string' does not name a type 1 | string insertSpace(string s){ | ^~~~~~
s293678460
p03992
C
#include <stdio.h> #include <string.h> int mian(){ char ary[14]; fgets(ary,sizeof(char)*4,stdin); strcat(ary," "); fgets(ary,sizeof(char)*8,stdin); printf("%s\n",ary); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s963353819
p03992
C
int main(){ int num; int counter=0; scanf("%d",num); int array[num]; for (int i=0;i<num;i++){ scanf("%d",&array[i]); } for (int i=0;i<num;i++){ if(array[array[i]]=array[i]){ count++; } } return 0; }
main.c: In function 'main': main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%d",num); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(){ main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%d",num); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:12:25: error: 'count' undeclared (first use in this function); did you mean 'counter'? 12 | count++; | ^~~~~ | counter main.c:12:25: note: each undeclared identifier is reported only once for each function it appears in
s969135720
p03992
C++
#include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <set> #include <functional> #include <map> #include <queue> #include <cmath> #include <string> #include <stack> #define SIZE 12 using namespace std; typedef long long int ll; typedef pair <int,int> int main(void){ int string str; scanf("%s",str); cout << str.substr(1.4) << " " << str.substr(5.8); return 0; }
a.cc:16:9: error: two or more data types in declaration of 'main' 16 | typedef pair <int,int> | ^~~~~~~~~~~~~~
s622240440
p03992
Java
Public class Main{ import java.util.*; public static void main(String [] args){ Scanner sc = new Scanner (System.in); String in = sc.next(); return in.substring(0,4) + " " + in.substring(4); } }
Main.java:1: error: class, interface, enum, or record expected Public class Main{ ^ Main.java:3: error: illegal start of type import java.util.*; ^ Main.java:3: error: <identifier> expected import java.util.*; ^ 3 errors
s980381162
p03992
Java
import java.util.*; import java.io.*; public class Test {// Main public static void main(String[] args){ String Str = new String("CODEFESTIVAL"); String a = Str.substring(0,4); String b = Str.substring(3); a = a.concat(" "); b = b.concat("\n"); System.out.println(a.concat(b)); } }
Main.java:3: error: class Test is public, should be declared in a file named Test.java public class Test {// Main ^ 1 error
s082927017
p03992
C
int main(){ int num; int counter=0; scanf("%d",num); int array[num]; for (int i=0;i<num;i++){ scanf("%d",array[i]); } for (int i=0;i<num;i++){ if(array[array[i]]=array[i]){ count++; } } return 0; }
main.c: In function 'main': main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%d",num); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(){ main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%d",num); | ^~~~~ main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:12:25: error: 'count' undeclared (first use in this function); did you mean 'counter'? 12 | count++; | ^~~~~ | counter main.c:12:25: note: each undeclared identifier is reported only once for each function it appears in
s687098834
p03992
C
#include <stdio.h> #include <string.h> int mian(){ char ary[14]; fgets(ary,sizeof(char)*4,stdin); ary[4]=" "; fgets(ary,sizeof(char)*8,stdin); printf("%d\n",ary); return 0; }
main.c: In function 'mian': main.c:6:7: error: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion] 6 | ary[4]=" "; | ^
s415817789
p03992
C++
#include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <set> #include <functional> #include <map> #include <queue> #include <cmath> #include <string> #include <stack> #define SIZE 12 using namespace std; typedef long long int ll; typedef pair <int,int> int main(){ int string str; scanf("%s",str); cout << str.substr(1,4) << " " << str.substr(5,8); return 0; }
a.cc:16:9: error: two or more data types in declaration of 'main' 16 | typedef pair <int,int> | ^~~~~~~~~~~~~~
s119950125
p03992
C++
s = input() for i in range(12): if i == 4: print('', s[i], end = '') else: print(s[i], end = '') print()
a.cc:4:23: error: empty character constant 4 | print('', s[i], end = '') | ^~ a.cc:4:39: error: empty character constant 4 | print('', s[i], end = '') | ^~ a.cc:6:35: error: empty character constant 6 | print(s[i], end = '') | ^~ a.cc:1:1: error: 's' does not name a type 1 | s = input() | ^
s448512780
p03992
C++
public class Main { public static void main(String[] args) { String firstPart = args[0].substring(0, 4); String secondPart = args[0].substring(4, 12); System.out.println(firstPart + " " + secondPart); } }
a.cc:1:1: error: expected unqualified-id before 'public' 1 | public class Main { | ^~~~~~
s679149363
p03992
Java
import java.io.*; import java.util.*; public class Sample{ public static void main (String[] args) throws IOException { //BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); Scanner s=new Scanner(System.in); String str=s.nextLine(); for(int i=0;i<12;i++){ if(i==4) System.out.print(" "); System.out.print(str.charAt(i)); } } }
Main.java:3: error: class Sample is public, should be declared in a file named Sample.java public class Sample{ ^ 1 error
s770026879
p03992
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] lst = new char[12]; String tmp = sc.nextLine(); lst = tmp.toCharArray(); String result = ""; for (int i = 0; i < 12; i++) { result += lst[i]; if (i == 3) { result += " "; } } System.out.println(result); } }
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s184911429
p03992
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string str; cin >> str; for (auto itr = str.begin(); itr != str.end(); ++ itr){ if (*(itr - str.begin()) == 4){ cout << " "; } cout << *itr; } return 0; }
a.cc: In function 'int main()': a.cc:12:13: error: invalid type argument of unary '*' (have '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::difference_type' {aka 'long int'}) 12 | if (*(itr - str.begin()) == 4){ | ^~~~~~~~~~~~~~~~~~~~
s433597116
p03992
C++
#include<iostream> using namespace std; int main() { // get a string string s; cin >> s; char *schar = s.c_str(); // output for(i=0; i<schar.length(); i++) { if (i=3) cout<<' '; cout<<schar[i]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:26: error: invalid conversion from 'const char*' to 'char*' [-fpermissive] 9 | char *schar = s.c_str(); | ~~~~~~~^~ | | | const char* a.cc:13:5: error: 'i' was not declared in this scope 13 | for(i=0; i<schar.length(); i++) | ^ a.cc:13:18: error: request for member 'length' in 'schar', which is of non-class type 'char*' 13 | for(i=0; i<schar.length(); i++) | ^~~~~~
s117312350
p03992
C++
#include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <set> #include <functional> #include <map> #include <queue> #include <cmath> #include <string> #include <stack> #define SIZE 12 using namespace std; typedef long long int ll; typedef pair <int,int> int main(){ string str; scanf("%s",str); cout << str.substr(1.4) << " " << str.substr(5.8); return 0; }
a.cc:16:9: error: two or more data types in declaration of 'main' 16 | typedef pair <int,int> | ^~~~~~~~~~~~~~
s250763123
p03992
C++
#include <cstdlib> #include <cstdio> #include <iostream> #include <cmath> #include <algorithm> #include <vector> #include <set> #include <map> #include <cstring> #include <stdio.h> using namespace std; typedef long long LL; typedef unsigned long long ULL; #define SIZE(x) (int((x).size())) #define rep(i,l,r) for (int i=(l); i<=(r); i++) #define repd(i,r,l) for (int i=(r); i>=(l); i--) #define rept(i,c) for (typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++) #ifndef ONLINE_JUDGE #define debug(x) { cerr<<#x<<" = "<<(x)<<endl; } #else #define debug(x) {} #endif void lemon() { char buf[100]; gets(buf); rep(i,0,3) printf("%c",buf[i]); printf(" "); rep(i,4,11) printf("%c",buf[i]); } int main() { ios::sync_with_stdio(true); lemon(); return 0; }
a.cc: In function 'void lemon()': a.cc:30:24: error: 'gets' was not declared in this scope; did you mean 'getw'? 30 | char buf[100]; gets(buf); | ^~~~ | getw
s824125407
p03992
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main() { cin >> str; for (auto itr = str.begin(); itr != str.end(); ++ itr){ if (*(itr - str.begin()) == 4){ cout << " "; } cout << *itr; } return 0; }
a.cc: In function 'int main()': a.cc:10:12: error: 'str' was not declared in this scope; did you mean 'std'? 10 | cin >> str; | ^~~ | std