submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s584557582
p00423
C++
#include<cstdio> #include<algorithm> #include<cmath> using namespace std; int main(){ while(true){ int pa = 0, pb = 0; int a, b scanf("%d", &n); if(!n) break; for(i = 0; i < n; i++){ scanf("%d%d", &a, &b); if(a > b) pa += a + b; else if(b > a) pb += a + b; else if(a == b){ pa += a; pb += b; } } printf("%d %d\n", pa, pb); } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: expected initializer before 'scanf' 11 | scanf("%d", &n); | ^~~~~ a.cc:12:21: error: 'n' was not declared in this scope 12 | if(!n) break; | ^ a.cc:13:21: error: 'i' was not declared in this scope 13 | for(i = 0; i < n; i++){ | ^ a.cc:13:32: error: 'n' was not declared in this scope 13 | for(i = 0; i < n; i++){ | ^ a.cc:14:44: error: 'b' was not declared in this scope 14 | scanf("%d%d", &a, &b); | ^
s404163274
p00423
C++
#include<cstdio> #include<algorithm> #include<cmath> using namespace std; int main(){ while(true){ int pa = 0, pb = 0; int a, b, n, i scanf("%d", &n); if(!n) break; for(i = 0; i < n; i++){ scanf("%d%d", &a, &b); if(a > b) pa += a + b; else if(b > a) pb += a + b; else if(a == b){ pa += a; pb += b; } } printf("%d %d\n", pa, pb); } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: expected initializer before 'scanf' 11 | scanf("%d", &n); | ^~~~~ a.cc:13:21: error: 'i' was not declared in this scope 13 | for(i = 0; i < n; i++){ | ^
s915585808
p00423
C++
#include<iostream> using namespace std; int main() { int a,b,n; while(cin>>n, n) { int x=0, y=0; while(n--) { cin>>a>>b; if(a<b) {y+=a+b;} else if(a>b) {x+=a+b;} else {x+=a; y+=b;} } cout<<x<<" "<<y<<endl; }
a.cc: In function 'int main()': a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s234451836
p00423
C++
#include<iostream> using namespace std; int main() { int a,b,n; while(cin>>n, n) { int x=0, y=0; while(n--) { cin>>a>>b; if(a<b) {y+=a+b;} else if(a>b) {x+=a+b;} else {x+=a; y+=b;} } } cout<<x<<" "<<y<<endl; }
a.cc: In function 'int main()': a.cc:18:8: error: 'x' was not declared in this scope 18 | cout<<x<<" "<<y<<endl; | ^ a.cc:18:16: error: 'y' was not declared in this scope 18 | cout<<x<<" "<<y<<endl; | ^
s794221190
p00423
C++
#include<iostream> using namespace std; int main() { int x,y,n; while(cin>>n, n) { int a=0, b=0; while(n--) { cin>>x>>y; if(x<y) { b+=x+y;} else if(x>y) { a+=x+y;} else if(x==y) {a+=a; b+=b;} } } cout<<a<<b<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:23: error: 'a' was not declared in this scope 18 | cout<<a<<b<<endl; | ^ a.cc:18:26: error: 'b' was not declared in this scope 18 | cout<<a<<b<<endl; | ^
s335105471
p00423
C++
#include <stdio.h> main() { int A,B,a,b,i,n; while(1) while(scanf("%d",&n)){ if(n==0) break; A=0; B=0; for(i=1;i<n+1;i++){ scanf("%d %d",&a,&b); if(a>b) A+=a+b; else if(a<b) B+=a+b; else A+=a,B+=b;} } printf("%d %d\n",A,B);} }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main() | ^~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s203091684
p00423
C++
#include <stdio.h> main() { int A,B,a,b,i,n; while(1) while(scanf("%d",&n)){ if(n==0) break; A=0; B=0; for(i=1;i<n+1;i++){ scanf("%d %d",&a,&b); if(a>b) A+=a+b; else if(a<b) B+=a+b; else A+=a,B+=b;} } printf("%d %d\n",A,B);} } }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main() | ^~~~ a.cc:18:1: error: expected declaration before '}' token 18 | } | ^ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s274056867
p00423
C++
#include <stdio.h> main() { int A,B,a,b,i,n; while(scanf("%d",&n),n==0){ if(n==0) break; A=0; B=0; for(,,){ for(i=1;i<n+1;i++){ scanf("%d %d",&a,&b); if(a>b) A+=a+b; else if(a<b) B+=a+b; else A+=a,B+=b;} printf("%d %d\n",A,B);} } }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main() | ^~~~ a.cc: In function 'int main()': a.cc:10:13: error: expected primary-expression before ',' token 10 | for(,,){ | ^ a.cc:10:14: error: expected primary-expression before ',' token 10 | for(,,){ | ^ a.cc:10:15: error: expected primary-expression before ')' token 10 | for(,,){ | ^ a.cc:17:9: error: expected primary-expression before '}' token 17 | } | ^ a.cc:16:32: error: expected ';' before '}' token 16 | printf("%d %d\n",A,B);} | ^ | ; 17 | } | ~ a.cc:17:9: error: expected primary-expression before '}' token 17 | } | ^ a.cc:16:32: error: expected ')' before '}' token 16 | printf("%d %d\n",A,B);} | ^ | ) 17 | } | ~ a.cc:10:12: note: to match this '(' 10 | for(,,){ | ^ a.cc:17:9: error: expected primary-expression before '}' token 17 | } | ^
s012999286
p00423
C++
#include <iostream> using namespace std; #define rep(i, n) for(int i = 0; i < (int)n; ++i) int main(void){ int n; int a = 0, b = 0; while(true){ cin >> n; if(c == 0) break; rep(i, n){ int x, y; cin >> x >> y; if(x > y){ a += x + y; } if(y > x){ b += x + y; } if(y == x){ a += x; b += y; } } cout << a << " " << b << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:20: error: 'c' was not declared in this scope 12 | if(c == 0) break; | ^
s305741910
p00423
C++
#include <stdio.h> int main(){ int n,i; int a,b,f,t; while(1){ scanf("%d",&n); if(n==0)break; a=0; b=0; f=0; t=0; for(i=0;i<n;i++){ scanf("%d %d",&a,&b); if(a==b){ f+=a; t+=b; } else if(a>b){ f+=a+b; } else if(a<b){ t+=a+b; } } ptintf("%d %d\n",f,t); } return 0; }
a.cc: In function 'int main()': a.cc:27:1: error: 'ptintf' was not declared in this scope; did you mean 'printf'? 27 | ptintf("%d %d\n",f,t); | ^~~~~~ | printf
s189509593
p00423
C++
#include <iostream> using namespace std; int n, a, b, sa, sb; int main(){ for(;;){ cin >> n; if(n == 0){ break; }else{ for(int i = 0; i < n; i++){ cin >> a >> b; if(a < b){ sb += a + b; }else if(a > b){ sa += b + a; }else{ sa += a; sb += b; } } cout << sa << " " << sb << endl; } } } return 0; }
a.cc:27:3: error: expected unqualified-id before 'return' 27 | return 0; | ^~~~~~ a.cc:28:1: error: expected declaration before '}' token 28 | } | ^
s079410965
p00423
C++
#include <iostream> #include <cstdlib> using namespace std; struct player{ int point ; int card[10000]; private: void player(){point =0;} }; int main() { int loop; player a, b; cin >> loop; for(int c = 0; c < loop; c++) { cin >> a.card[c]; cin >> b.card[c]; } for(int c = 0; c < loop; c++) { if(a.card[c] < b.card[c]) b.point += a.card[c] + b.card[c]; if(a.card[c] == b.card[c]) a.point += a.card[c], b.point +=b.card[c]; if(a.card[c] > b.card[c]) a.point += a.card[c] + b.card[c]; } cout << a.point << " " << b.point << endl; return EXIT_SUCCESS; }
a.cc:9:3: error: return type specification for constructor invalid 9 | void player(){point =0;} | ^~~~ a.cc: In function 'int main()': a.cc:15:12: error: 'player::player()' is private within this context 15 | player a, b; | ^ a.cc:9:8: note: declared private here 9 | void player(){point =0;} | ^~~~~~ a.cc:15:15: error: 'player::player()' is private within this context 15 | player a, b; | ^ a.cc:9:8: note: declared private here 9 | void player(){point =0;} | ^~~~~~
s939752286
p00423
C++
// cardgame.cpp #include <iostream> using namespace std; void main(){ int n; int i,j; int a[10000], b[10000]; int a_point=0, b_point=0; cin >> n; for(i=0;i<n;++i){ cin >> a[i]; cin >> b[i]; } for(j=0;j<n;++j){ if(a[j]>b[j]) a_point+=(a[j]+b[j]); else if(a[j]<b[j]) b_point+=(a[j]+b[j]); else if(a[j]==b[j]){ a_point+=a[j]; b_point+=b[j]; } } cout << a_point << " " << b_point << endl; }
a.cc:5:1: error: '::main' must return 'int' 5 | void main(){ | ^~~~
s471984992
p00423
C++
#include<iostream> #include<vector> int main(){ int a,b,c,m=0; while(m==0){ std::cin>>c; if(c==0)break; for(int i=0;i<c;i++){ int ap=0,bp=0; std::cin>>a>>b; if(a>b)ap+=a,ap+=b; else if(b>a){ bp+=a;bp+=b; }else{ ap+=a,bp+=b; } } std::cout<<ap<<" "<<bp<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:28: error: 'ap' was not declared in this scope; did you mean 'a'? 19 | std::cout<<ap<<" "<<bp<<std::endl; | ^~ | a a.cc:19:37: error: 'bp' was not declared in this scope; did you mean 'b'? 19 | std::cout<<ap<<" "<<bp<<std::endl; | ^~ | b
s071297817
p00423
C++
#include <iostream> using namespace std; int main(){ int n; cin>>n; while(n!=0) int point[2]; enum { A, B, }; int sum[2] = {}; for (int i = 0; i < n; i++) { cin>>point[A]>>point[B]; if (point[A]>point[B]) { for (auto j : point) { sum[A]+=j; } } else if(point[A] == point[B]) { for (auto j : sum) { j+=point[A]; } } else { for (auto j : point) { sum[B]+=j; } } } cout<<sum[A]<<" "<<sum[B]<<endl; cin>>n; } return 0; }
a.cc: In function 'int main()': a.cc:14:30: error: 'point' was not declared in this scope 14 | cin>>point[A]>>point[B]; | ^~~~~ a.cc: At global scope: a.cc:32:9: error: expected unqualified-id before 'return' 32 | return 0; | ^~~~~~ a.cc:33:1: error: expected declaration before '}' token 33 | } | ^
s540976185
p00423
C++
#include <iostream> using namespace std; int main(void) { int i, n, a, b, as = 0, bs = 0; cin >> n; for(i=0 ; i<n ; i++) { cin >> a >> b; if(a > b) { as += a + b; } else if(a < b) { bs += a + b; } else { as += a; bs += b; } } cout.form("%d %d\n", as, bs); return 0; }
a.cc: In function 'int main()': a.cc:14:14: error: 'std::ostream' {aka 'class std::basic_ostream<char>'} has no member named 'form' 14 | cout.form("%d %d\n", as, bs); | ^~~~
s730860414
p00423
C++
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; void main(){ int n; int a,b; while(cin >> n, n){ int asum = 0; int bsum = 0; for(int i=0; i<n; i++){ cin >> a >> b; if(a > b) asum += a+b; else if(a < b) bsum += a+b; else{ asum += a; bsum += b; } } cout << asum << " " << bsum << endl; } return; }
a.cc:7:1: error: '::main' must return 'int' 7 | void main(){ | ^~~~ a.cc: In function 'int main()': a.cc:24:3: error: return-statement with no value, in function returning 'int' [-fpermissive] 24 | return; | ^~~~~~
s875921593
p00423
C++
#include<stdio.h> int main(void){ int a_point,b_point,i,a_card,b_card,n; while(1){ scanf("%d",&n); if(n==0) break; a_point=0,b_point=0; for(i=0;i<n;n++){ scanf("%d %d",&a_card,&b_card); if(a_card>b_card) a_point+=a_card+b_card; else if(a_card<b_card) b_point+=a_card+b_card; else { a_point+=a_card; b_point+=b_card; } printf("%d %d\n",a_point,b_point); } return 0; }
a.cc: In function 'int main()': a.cc:20:2: error: expected '}' at end of input 20 | } | ^ a.cc:3:15: note: to match this '{' 3 | int main(void){ | ^
s300219896
p00424
Java
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.HashMap; import java.util.InputMismatchException; import java.util.Map; public class Main0501 { MyScanner sc; PrintWriter writer; public void solve() { int n = sc.nextInt(); if (n == 0) { return; } Map<Character, Character> map = new HashMap<>(n); for (int i = 0; i < n; i++) { map.put(sc.nextChar(), sc.nextChar()); } StringBuilder sb = new StringBuilder(); int m = sc.nextInt(); for (int i = 0; i < m; i++) { char c = sc.nextChar(); if (map.containsKey(c)) { sb.append(map.get(c)); } else { sb.append(c); } } writer.println(sb); } public Main0501() { sc = new MyScanner(System.in); writer = new PrintWriter(System.out); } public static void main(String[] args) { Main0501 m = new Main0501(); m.solve(); m.writer.flush(); } class MyScanner { InputStream is; private byte[] buffer = new byte[1024]; private int bufferPointer = 0; private int bufferLength = 0; MyScanner(InputStream is) { this.is = is; } private int readByte() { if (bufferLength == -1) { throw new InputMismatchException(); } if (bufferPointer >= bufferLength) { bufferPointer = 0; try { bufferLength = is.read(buffer); } catch (IOException e) { throw new InputMismatchException(); } if (bufferLength <= -1) { return -1; } } return buffer[bufferPointer++]; } String next() { int b = skip(); StringBuilder sb = new StringBuilder(); while (isChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } char nextChar() { int b = skip(); return (char) b; } double nextDouble() { return Double.parseDouble(next()); } int nextInt() { int num = 0; int b; boolean negative = false; while ((b = readByte()) != -1 && !isDigit(b) && b != '-') ; if (b == '-') { negative = true; b = readByte(); } while (true) { if (isDigit(b)) { num = num * 10 + (b - '0'); } else { return negative ? -num : num; } b = readByte(); } } int[] nextIntArray(int length) { int[] array = new int[length]; for (int i = 0; i < length; i++) { array[i] = sc.nextInt(); } return array; } long nextLong() { long num = 0; int b; boolean negative = false; while ((b = readByte()) != -1 && !isDigit(b) && b != '-') ; if (b == '-') { negative = true; b = readByte(); } while (true) { if (isDigit(b)) { num = num * 10 + (b - '0'); } else { return negative ? -num : num; } b = readByte(); } } // from '!' to '~' private boolean isChar(int b) { return b >= 33 && b <= 126; } private boolean isDigit(int b) { return b >= '0' && b <= '9'; } private int skip() { int b; while ((b = readByte()) != -1 && !isChar(b)) ; return b; } } }
Main.java:8: error: class Main0501 is public, should be declared in a file named Main0501.java public class Main0501 { ^ 1 error
s694493269
p00424
Java
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.HashMap; import java.util.InputMismatchException; import java.util.Map; public class Main0501 { MyScanner sc; PrintWriter writer; public void solve() { int n = sc.nextInt(); if (n == 0) { return; } Map<Character, Character> map = new HashMap<Character, Character>(n); for (int i = 0; i < n; i++) { map.put(sc.nextChar(), sc.nextChar()); } StringBuilder sb = new StringBuilder(); int m = sc.nextInt(); for (int i = 0; i < m; i++) { char c = sc.nextChar(); if (map.containsKey(c)) { sb.append(map.get(c)); } else { sb.append(c); } } writer.println(sb); } public Main0501() { sc = new MyScanner(System.in); writer = new PrintWriter(System.out); } public static void main(String[] args) { Main0501 m = new Main0501(); m.solve(); m.writer.flush(); } class MyScanner { InputStream is; private byte[] buffer = new byte[1024]; private int bufferPointer = 0; private int bufferLength = 0; MyScanner(InputStream is) { this.is = is; } private int readByte() { if (bufferLength == -1) { throw new InputMismatchException(); } if (bufferPointer >= bufferLength) { bufferPointer = 0; try { bufferLength = is.read(buffer); } catch (IOException e) { throw new InputMismatchException(); } if (bufferLength <= -1) { return -1; } } return buffer[bufferPointer++]; } String next() { int b = skip(); StringBuilder sb = new StringBuilder(); while (isChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } char nextChar() { int b = skip(); return (char) b; } double nextDouble() { return Double.parseDouble(next()); } int nextInt() { int num = 0; int b; boolean negative = false; while ((b = readByte()) != -1 && !isDigit(b) && b != '-') ; if (b == '-') { negative = true; b = readByte(); } while (true) { if (isDigit(b)) { num = num * 10 + (b - '0'); } else { return negative ? -num : num; } b = readByte(); } } int[] nextIntArray(int length) { int[] array = new int[length]; for (int i = 0; i < length; i++) { array[i] = sc.nextInt(); } return array; } long nextLong() { long num = 0; int b; boolean negative = false; while ((b = readByte()) != -1 && !isDigit(b) && b != '-') ; if (b == '-') { negative = true; b = readByte(); } while (true) { if (isDigit(b)) { num = num * 10 + (b - '0'); } else { return negative ? -num : num; } b = readByte(); } } // from '!' to '~' private boolean isChar(int b) { return b >= 33 && b <= 126; } private boolean isDigit(int b) { return b >= '0' && b <= '9'; } private int skip() { int b; while ((b = readByte()) != -1 && !isChar(b)) ; return b; } } }
Main.java:8: error: class Main0501 is public, should be declared in a file named Main0501.java public class Main0501 { ^ 1 error
s554314170
p00424
Java
import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Deque; import java.util.HashMap; import java.util.InputMismatchException; import java.util.Map; import java.util.PriorityQueue; import java.math.BigInteger; public class Main{ static final InputStream in=System.in; static final PrintWriter out=new PrintWriter(System.out); static final int INF=Integer.MAX_VALUE/2; static final long LINF=Long.MAX_VALUE/2; int n,m; public static void main(String[] args) throws IOException{ InputReader ir=new InputReader(in); HashMap<String,String> map=new HashMap<String,String>(); StringBuilder sb=new StringBuilder(); while(true){ n=ir.nextInt(); if(n==0) break; while(n-->0){ String b=ir.next(); String a=ir.next(); map.put(a,b); } m=ir.nextInt(); while(m-->0){ String str=ir.next(); sb.append(map.containsKey(str)?map.get(str):str); } out.println(sb.toString()); map.clear(); } out.flush(); } static class InputReader { private InputStream in; private byte[] buffer=new byte[1024]; private int curbuf; private int lenbuf; public InputReader(InputStream in) {this.in=in;} public int readByte() { if(lenbuf==-1) throw new InputMismatchException(); if(curbuf>=lenbuf){ curbuf= 0; try{ lenbuf=in.read(buffer); } catch (IOException e) { throw new InputMismatchException(); } if(lenbuf<=0) return -1; } return buffer[curbuf++]; } public boolean isSpaceChar(int c){return !(c>=33&&c<=126);} private int skip() {int b; while((b = readByte())!=-1&&isSpaceChar(b)); return b;} public String next() { int b=skip(); StringBuilder sb=new StringBuilder(); while(!isSpaceChar(b)){ sb.appendCodePoint(b); b=readByte(); } return sb.toString(); } public int nextInt() { int c=readByte(); while (isSpaceChar(c)) c=readByte(); boolean minus=false; if (c=='-') { minus=true; c=readByte(); } int res=0; do{ if(c<'0'||c>'9') throw new InputMismatchException(); res=res*10+c-'0'; c=readByte(); }while(!isSpaceChar(c)); return (minus)?-res:res; } public long nextLong() { int c=readByte(); while (isSpaceChar(c)) c=readByte(); boolean minus=false; if (c=='-') { minus=true; c=readByte(); } long res = 0; do{ if(c<'0'||c>'9') throw new InputMismatchException(); res=res*10+c-'0'; c=readByte(); }while(!isSpaceChar(c)); return (minus)?-res:res; } public int[] toIntArray(int n){ int[] a=new int[n]; for(int i=0;i<n;i++) a[i]=nextInt(); return a; } } }
Main.java:29: error: non-static variable n cannot be referenced from a static context n=ir.nextInt(); ^ Main.java:30: error: non-static variable n cannot be referenced from a static context if(n==0) break; ^ Main.java:31: error: non-static variable n cannot be referenced from a static context while(n-->0){ ^ Main.java:36: error: non-static variable m cannot be referenced from a static context m=ir.nextInt(); ^ Main.java:37: error: non-static variable m cannot be referenced from a static context while(m-->0){ ^ 5 errors
s849513919
p00424
Java
import java.io.PrintWriter; import java.util.Scanner; public class Mian{ public static void main(String[] args) { Scanner sc = new Scanner (System.in); PrintWriter out = new PrintWriter(System.out); while(sc.hasNext()){ int m = sc.nextInt(); if(m == 0)break; String temp [][] = new String[2][m]; for (int i = 0; i < m ; i++ ){ temp[0][i] = sc.next(); temp[1][i] = sc.next(); } int n = sc.nextInt(); String ans = ""; for(int i = 0 ; i < n ; i++){ ans = sc.next(); for(int j = 0 ; j < m ; j++){ if(( temp[0][j].equals(ans) )) ans = temp[1][j]; } out.print(ans); } out.println(); out.flush(); } } }
Main.java:3: error: class Mian is public, should be declared in a file named Mian.java public class Mian{ ^ 1 error
s587613753
p00424
Java
import java.io.PrintWriter; import java.util.Scanner; public class Mian{ public static void main(String[] args) { Scanner sc = new Scanner (System.in); PrintWriter out = new PrintWriter(System.out); while(sc.hasNext()){ int m = sc.nextInt(); if(m == 0)break; String temp [][] = new String[2][m]; for (int i = 0; i < m ; i++ ){ temp[0][i] = sc.next(); temp[1][i] = sc.next(); } int n = sc.nextInt(); String ans = ""; for(int i = 0 ; i < n ; i++){ ans = sc.next(); for(int j = 0 ; j < m ; j++){ if(( temp[0][j].equals(ans) )) ans = temp[1][j]; } out.print(ans); } out.println(); out.flush(); } } }
Main.java:3: error: class Mian is public, should be declared in a file named Mian.java public class Mian{ ^ 1 error
s544389177
p00424
Java
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigInteger; public class Main{ static PrintWriter out; static InputReader ir; static void solve(){ for(;;){ int n=ir.nextInt(); if(n==0) return; HashMap<String,String> map=new HashMap<String,String>(); StringBuilder sb=new StringBuilder(); while(n-->0) map.put(ir.next(),ir.next()); int m=ir.nextInt(); while(m-->0){ String str=ir.next(); sb.append((map.containsKey(str))?map.get(str):str); } out.println(sb.toString()); } } public static void main(String[] args) throws Exception{ ir=new InputReader(System.in); out=new PrintWriter(System.out); solve(); out.flush(); } static class InputReader { private InputStream in; private byte[] buffer=new byte[1024]; private int curbuf; private int lenbuf; public InputReader(InputStream in) {this.in=in; this.curbuf=this.lenbuf=0;} public boolean hasNextByte() { if(curbuf>=lenbuf){ curbuf= 0; try{ lenbuf=in.read(buffer); }catch(IOException e) { throw new InputMismatchException(); } if(lenbuf<=0) return false; } return true; } private int readByte(){if(hasNextByte()) return buffer[curbuf++]; else return -1;} private boolean isSpaceChar(int c){return !(c>=33&&c<=126);} private void skip(){while(hasNextByte()&&isSpaceChar(buffer[curbuf])) curbuf++;} public boolean hasNext(){skip(); return hasNextByte();} public String next(){ if(!hasNext()) throw new NoSuchElementException(); StringBuilder sb=new StringBuilder(); int b=readByte(); while(!isSpaceChar(b)){ sb.appendCodePoint(b); b=readByte(); } return sb.toString(); } public int nextInt() { if(!hasNext()) throw new NoSuchElementException(); int c=readByte(); while (isSpaceChar(c)) c=readByte(); boolean minus=false; if (c=='-') { minus=true; c=readByte(); } int res=0; do{ if(c<'0'||c>'9') throw new InputMismatchException(); res=res*10+c-'0'; c=readByte(); }while(!isSpaceChar(c)); return (minus)?-res:res; } } }
Main.java:20: error: cannot find symbol HashMap<String,String> map=new HashMap<String,String>(); ^ symbol: class HashMap location: class Main Main.java:20: error: cannot find symbol HashMap<String,String> map=new HashMap<String,String>(); ^ symbol: class HashMap location: class Main 2 errors
s125578026
p00424
Java
import java.util.Scanner; public class Converse{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); StringBuilder[] ans = new StringBuilder[1000]; int index = 0; while( n != 0 ){ String[][] data = new String[n][2]; for(int i = 0; i < n; i++){ data[i][0] = stdIn.next(); data[i][1] = stdIn.next(); } int x = stdIn.nextInt(); for(int i = 0; i < x; i++){ String s = stdIn.next(); for(int j = 0; j < n; j++){ if( s.equals(data[j][0]) ){ s = new String(data[j][1]); break; } } if( i == 0 ){ ans[index] = new StringBuilder(s); } else { ans[index].append(s); } } index++; n = stdIn.nextInt(); } for(int i = 0; i < index; i++){ System.out.println(ans[i].toString()); } } }
Main.java:3: error: class Converse is public, should be declared in a file named Converse.java public class Converse{ ^ 1 error
s907606432
p00424
Java
import java.util.*; public class DataConversion0501 { static Scanner kbd = new Scanner(System.in); public static void main(String[] args){ while(kbd.hasNext()){ int n = kbd.nextInt(); if(n!=0){ String[] in = new String[n]; String[] out = new String[n]; String s = ""; int i; for(i=0; i<n; i++){ in[i] = kbd.next(); out[i] = kbd.next(); } n = kbd.nextInt(); for(; n>0; n--){ String a = kbd.next(); for(i=0; !in[i].equals(a) && i+1<in.length; i++); if(!in[i].equals(a)) s += a; else s += out[i]; } System.out.println(s); } } } }
Main.java:2: error: class DataConversion0501 is public, should be declared in a file named DataConversion0501.java public class DataConversion0501 { ^ 1 error
s674233941
p00424
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.HashMap; public class Main { public static void main(String[] args) { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); HashMap<String,String> c = new HashMap<String,String>(); while(true){ int tn = Integer.parseInt(in.readLine()); if(tn == 0) break; for(int i=0; i < tn; i++){ String[] tl = in.readLine().split(" "); c.put(tl[0],tl[1]); } int wn = Integer.parseInt(in.readLine()); StringBuilder answer = new StringBuilder(); for(int i=0; i < wn; i++){ String word = in.readLine(); if(c.containsKey(word)){ answer.append(c.get(word)); }else{ answer.append(word); } } System.out.println(answer.toString()); } } }
Main.java:11: error: unreported exception IOException; must be caught or declared to be thrown int tn = Integer.parseInt(in.readLine()); ^ Main.java:16: error: unreported exception IOException; must be caught or declared to be thrown String[] tl = in.readLine().split(" "); ^ Main.java:20: error: unreported exception IOException; must be caught or declared to be thrown int wn = Integer.parseInt(in.readLine()); ^ Main.java:24: error: unreported exception IOException; must be caught or declared to be thrown String word = in.readLine(); ^ 4 errors
s390895561
p00424
C
#include <cstdio> #include <map> using namespace std; int main() { int n, m; char before, after; map<char, char> conversion; int i; while (scanf("%d", &n) * n != 0){ conversion.clear(); for (i = 0; i < n; i++){ scanf(" %c %c", &before, &after); conversion[before] = after; } scanf("%d", &m); for (i = 0; i < m; i++){ scanf(" %c", &before); if (conversion.count(before)){ printf("%c", conversion[before]); } } puts(""); } return (0); }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s903885806
p00424
C
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 #include <stdio.h> char c[256]; void clear() { int i; for (i = 0; i < 256; i++) c[i] = 0; } int main() { int n; char f, t; while (1) { scanf("%d\n", &n); if (!n) break; clear(); while (n--) { scanf("%c %c\n", &f, &t); c[f] = t; } scanf("%d\n", &n); while (n--) { scanf("%c\n", &f); if (c[f]) printf("%c", c[f]); else printf("%c", f); } printf("\n"); } return 0; }
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 7 | ^ In file included from /usr/include/stdio.h:47, from main.c:27: /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t' 28 | size_t __nbytes); | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' +++ |+#include <stddef.h> 1 | /* Copyright (C) 1991-2025 Free Software Foundation, Inc. /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: error: unknown type name 'size_t' 37 | size_t __nbytes); | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:57:3: error: unknown type name 'cookie_read_function_t'; did you mean 'cookie_seek_function_t'? 57 | cookie_read_function_t *read; /* Read bytes. */ | ^~~~~~~~~~~~~~~~~~~~~~ | cookie_seek_function_t /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:3: error: unknown type name 'cookie_write_function_t'; did you mean 'cookie_close_function_t'? 58 | cookie_write_function_t *write; /* Write bytes. */ | ^~~~~~~~~~~~~~~~~~~~~~~ | cookie_close_function_t /usr/include/stdio.h:314:35: error: unknown type name 'size_t' 314 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) | ^~~~~~ /usr/include/stdio.h:130:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 129 | #include <bits/stdio_lim.h> +++ |+#include <stddef.h> 130 | /usr/include/stdio.h:320:47: error: unknown type name 'size_t' 320 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW | ^~~~~~ /usr/include/stdio.h:320:47: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:340:34: error: unknown type name 'size_t' 340 | int __modes, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/stdio.h:340:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:346:24: error: unknown type name 'size_t' 346 | size_t __size) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/stdio.h:346:24: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:385:44: error: unknown type name 'size_t' 385 | extern int snprintf (char *__restrict __s, size_t __maxlen, | ^~~~~~ /usr/include/stdio.h:385:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:389:45: error: unknown type name 'size_t' 389 | extern int vsnprintf (char *__restrict __s, size_t __maxlen, | ^~~~~~ /usr/include/stdio.h:389:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:690:30: error: unknown type name 'size_t' 690 | size_t *__restrict __n, int __delimiter, | ^~~~~~ /usr/include/stdio.h:690:30: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:693:28: error: unknown type name 'size_t' 693 | size_t *__restrict __n, int __delimiter, | ^~~~~~ /usr/include/stdio.h:693:28: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:698:27: error: unknown type name 'size_t' 698 | size_t *__restrict __n, | ^~~~~~ /usr/include/stdio.h:698:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:728:8: error: unknown type name 'size_t' 728 | extern size_t fread (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:728:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:728:46: error: unknown type name 'size_t' 728 | extern size_t fread (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:728:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:729:22: error: unknown type name 'size_t' 729 | size_t __n, FILE *__restrict __stream) __wur | ^~~~~~ /usr/include/stdio.h:729:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:735:8: error: unknown type name 'size_t' 735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:735:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:735:53: error: unknown type name 'size_t' 735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:735:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:736:23: error: unknown type name 'size_t' 736 | size_t __n, FILE *__restrict __s) __nonnull((4)); | ^~~~~~ /usr/include/stdio.h:736:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:756:8: error: unknown type name 'size_t' 756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:756:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:756:55: error: unknown type name 'size_t' 756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:756:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:757:31: error: unknown type name 'size_t' 757 | size_t __n, FILE *__restrict __stream) __wur | ^~~~~~ /usr/include/stdio.h:757:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:759:8: error: unknown type name 'size_t' 759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:759:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:759:62: error: unknown type name 'size_t' 759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:759:62: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:760:32: error: unknown type name 'size_t' 760 | size_t __n, FILE *__restrict __stream) | ^~~~~~ /usr/include/stdio.h:760:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
s016723013
p00424
C
#include<stdio.h> #include<stdlib.h> int main() { int n; int m; int i,j; char before[100]; char after[100]; char str[100]; while(1) { scanf("%d",&n); if(n==0)break; for(i<0;i<n;i++) { scanf("\n%c %c",&before[i],&after[i]); } scanf("\n%d",&m); for(i=0;i<m;i++) { scanf("\n%c",&str[i]); for(j=0;j<n;j++) { if(str[i]==before[j]) { str[i]=after[j]; break; } } } for(i=0;i<strnum;i++) { printf("%c",str[i]); } printf("\n"); } return 0; }
main.c: In function 'main': main.c:40:13: error: 'strnum' undeclared (first use in this function) 40 | for(i=0;i<strnum;i++) | ^~~~~~ main.c:40:13: note: each undeclared identifier is reported only once for each function it appears in
s814330527
p00424
C
#include<stdio.h> int main(void){ int n,m,i,j,flag; char a,b; int sb[62]={0},sa[62]={0}; while(scanf("%d%*c",&n),n!=0){ for(i=0;i<n;i++){ for(scanf("%c",&b);c!=' ';scanf("%c",&b)); scanf("%c %c",&sb[i],&sa[i]); getchar(); for(scanf("%c",&b);c!=' ';scanf("%c",&b)); } scanf("%d%*c",&m); for(scanf("%c",&b);c!=' ';scanf("%c",&b)); for(i=0;i<m;i++){ flag=0; scanf("%c",&a); getchar(); for(scanf("%c",&b);c!=' ';scanf("%c",&b)); for(j=0;j<n;j++){ if(sb[j]==a){ printf("%c",sa[j]); flag=1; break; } } if(!flag)printf("%c",a); } } puts(""); return 0; }
main.c: In function 'main': main.c:10:32: error: 'c' undeclared (first use in this function) 10 | for(scanf("%c",&b);c!=' ';scanf("%c",&b)); | ^ main.c:10:32: note: each undeclared identifier is reported only once for each function it appears in
s022514599
p00424
C
#include<stdio.h> int main(void){ int n,m,flag; int i,j; char ah[70],bh[70],jo; while(1){ scanf("%d ",&n); if(!n) break; for(i=0;i<n;i++){ scanf("%c %c ",&ah[i],&bh[i]); } scanf("%d ",&m); for(i=0;i<m;i++){ scanf("%c ",&jo); flag=0; for(j=0;j<n;j++){ if(jo==ah[j]){ printf("%c",bh[j]); flag=1; break; } } if(!flag) printf("%c",jo); } printf("\n"); } return 0;
main.c: In function 'main': main.c:29:9: error: expected declaration or statement at end of input 29 | return 0; | ^~~~~~
s935121120
p00424
C
#include <stdio.h> int main() { int n, m, i; char change[10000]={0}, ans[100000004]; char a,b, data; scanf("%d", &n); if(n==0) return 0; for(i=0; i<n; i++){ scanf("%c%c", &a, &b); change[a] = b; } scanf("%d", &m); for(i=0; i<m; i++){ scanf("%c", &data); if(change[data] != 0){ ans[i] = change[data]; }else ans[i] = data; } main();
main.c: In function 'main': main.c:27:9: error: expected declaration or statement at end of input 27 | main(); | ^~~~
s015850211
p00424
C
#include<stdio.h> #include<String.h> int main(){ char **conv; char *str; char c1,c2,c; int i,j,n,l; scanf("%d",&n);//convert data num while(n!=0){ conv = (char**)malloc(sizeof(char*)*n); for(i=0;i<n;i++) conv[i]=(char*)malloc(sizeof(char)*2); i = 0; while(1){ c = getchar(); if(c != '\n' && c !=' '){ conv[i/2][i%2] = c; i++; if(i == n*2) break; } } scanf("\n%d",&l);//converted data num str = (char*)malloc(sizeof(char)*(l + 1)); i = 0; while(1){ c = getchar(); if(c != '\n' && c !=' '){ for(j = 0; j < n; j++){ if(conv[j][0] == c){ c = conv[j][1];break;} } str[i] = c; i++; } if(l == i)break; } str[l]='\0'; printf("%s \n",str); for(i=0;i<n;i++) free(conv[i]); free(conv); free(str); scanf("%d",&n);//convert data num } return 0; }
main.c:2:9: fatal error: String.h: No such file or directory 2 | #include<String.h> | ^~~~~~~~~~ compilation terminated.
s867180478
p00424
C
#include<stdio.h> #include<stdlib.h> #include<String.h> int main(){ char **conv; char *str; char c1,c2,c; int i,j,n,l; scanf("%d",&n);//convert data num while(1){ if(n==0)break; conv = (char**)malloc(sizeof(char*)*n); for(i=0;i<n;i++) conv[i]=(char*)malloc(sizeof(char)*2); i = 0; while(1){ c = getchar(); if(c != '\n' && c !=' '){ conv[i/2][i%2] = c; i++; if(i == n*2) break; } } scanf("\n%d",&l);//converted data num str = (char*)malloc(sizeof(char)*(l + 1)); i = 0; while(1){ c = getchar(); if(c != '\n' && c !=' '){ for(j = 0; j < n; j++){ if(conv[j][0] == c){ c = conv[j][1];break;} } str[i] = c; i++; } if(l == i)break; } str[l]='\0'; printf("%s \n",str); for(i=0;i<n;i++) free(conv[i]); free(conv); free(str); scanf("%d",&n);//convert data num } return 0; }
main.c:3:9: fatal error: String.h: No such file or directory 3 | #include<String.h> | ^~~~~~~~~~ compilation terminated.
s702401456
p00424
C
#include <stdio.h> int main() { int n, m, i; char change[1000][2], c; while (1) { scanf("%d", &n); if (n == 0) break; for (i = 0;i < n;i++) { scanf("%c %c", &change[i][0], &change[i][1]); } scanf("%d", &m); while (m--) { scanf("%c", &c); for (i = 0;i < n;i++) { if (c == change[i][0]) { c = change[i][1]; break; } } printf("%c", c); } return 0; }
main.c: In function 'main': main.c:29:9: error: expected declaration or statement at end of input 29 | } | ^
s305166552
p00424
C
#include<stdio.h> #include<string.h> int n,m,i,j; char s[1000][9],x[9]; int main(){ scanf("%d",&n); while(n!=0){ for(i=0;i<=n;i++)gets(s[i]); //printf("\nAKB%d\n",n); scanf("%d",&m); for(i=0;i<m;i++){ scanf("%s",&x); for(j=0;j<n;j++){ if(x[0]==s[j][0]){ //strcpy(x,s[i]); x[0]=s[j][2]; break; } } printf("%c",x[0]); } printf("\n"); scanf("%d",&n); } return 0; }
main.c: In function 'main': main.c:10:34: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 10 | for(i=0;i<=n;i++)gets(s[i]); | ^~~~ | fgets
s333990712
p00424
C
#include <stdio.h> #include <string.h> int main(void) { int n; char conv[100][3]; int m; char c, t; int i, j; while (1){ scanf("%d", &n); getchar(); if (n == 0){ break; } for (i = 0; i < 26; i++){ conv[i][0] = 'a' + i; conv[i][1] = 'a' + i; } for (i = 30; i < 56; i++){ conv[i][0] = 'A' + i - 30; conv[i][1] = 'A' + i - 30; } for (i = 60; i < 70; i++){ conv[i][0] = '0' + i - 60; conv[i][1] = '0' + i - 60; } for (i = 0; i < n; i++){ scanf("%c", &c); getchar(); scanf("%c", &t); getchar(); if ('a' <= c && c <= 'z'){ conv[c - 'a'][1] = t; } else if ('A' <= c && c <= 'Z'){ conv[c - 'A' + 30][1] = t; } else { conv[c - '0' + 60][1] = t; } } scanf("%d", &m); getchar(); for (i = 0; i < m; i++){ scanf("%c", &c); getchar(); /* if ('a' <= c && c <= 'z'){ printf("%c", conv[c - 'a'][1]); } else if ('A' <= c && c <= 'Z'){ printf("%c", conv[c - 'A' + 30][1]); } else { printf("%c", conv[c - '0' + 60][1]);*/ } } printf("\n"); } return (0); }
main.c:68:9: error: expected identifier or '(' before 'return' 68 | return (0); | ^~~~~~ main.c:69:1: error: expected identifier or '(' before '}' token 69 | } | ^
s510631214
p00424
C
#include <iostream> using namespace std; int main(){ int n,i,tail; char s; char dic[256]; while(cin>>n,n){ for(i=0;i<256;i++) dic[i]=i; while(n--){ cin>>s; cin>>dic[(int)s]; } cin>>n; while(n--){ cin>>s; cout<<dic[(int)s]; } cout<<endl; } }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s392168882
p00424
C
n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;}
main.c:1:1: warning: data definition has no type or storage class 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} | ^ main.c: In function 'main': main.c:1:14: error: type of 'i' defaults to 'int' [-Wimplicit-int] 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} | ^~~~ main.c:1:30: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} main.c:1:30: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} | ^~~~~ main.c:1:30: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:45: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} | ^~~~ main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:1:55: error: implicit declaration of function 'bzero' [-Wimplicit-function-declaration] 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} | ^~~~~ main.c:1:55: warning: incompatible implicit declaration of built-in function 'bzero' [-Wbuiltin-declaration-mismatch] main.c:1:129: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration] 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} | ^~~~~~~ main.c:1:129: note: include '<stdio.h>' or provide a declaration of 'putchar' main.c:1:168: error: 'return0' undeclared (first use in this function) 1 | n,t[999];int main(i){for(;n*=scanf("%d",&n);puts("")){bzero(t,999);for(;n--;t[i]=*t)scanf(" %c %c",&i,t);for(scanf("%d",&n);n--;putchar(!t[i]*i+t[i]))scanf(" %c",&i);}return0;} | ^~~~~~~ main.c:1:168: note: each undeclared identifier is reported only once for each function it appears in
s762353302
p00424
C
//#include <stdio.h> // int main(){ // int n,m,i,j; // char x[62][2]; // char z,l; //while(1){ // scanf("%d",&n); // if(n==0){break;} // for(i=0;i<n;i++){ // scanf("%s",&x[i]); // } //scanf("%d",&m); //for(i=0;i<m;i++){ //scanf("%c",&l); //for(j=0;j<n;j++){ //if(l==x[j][0]){ //l=x[j][1]; //break; //} //} //printf("%c",l); //} //printf("\n"); //} //return 0; //} #include<stdio.h> int n,m,i,j; char z[1000][2],x; int main(){ while(n!=0){ scanf("%d",&n); for(i=0;i<n*2;i++){ scanf("%s",z[i]); } scanf("%d",&m); for(i=0;i<m;i++){ scanf("%c",x); for(j=0;j<=n;j++){ if(x==z[j*2][0]){ x=z[j*2+1][0]; break; } } printf("%c",x[0]); } printf("\n"); } return 0; }
main.c: In function 'main': main.c:45:17: error: subscripted value is neither array nor pointer nor vector 45 | printf("%c",x[0]); | ^
s266335446
p00424
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef DEBUG #define LOG(...) fprintf(stderr, __VA_ARGS__) #elif #define LOG(...) #endif // DEBUG struct convert_list { char from; char to; struct convert_list *next; }; typedef struct convert_list CONVERT_LIST; CONVERT_LIST* insert_list(CONVERT_LIST *list, char from, char to); char search_list(CONVERT_LIST *head, char target); int main(void) { while (1) { int num, convert_num; char from, to, target; int i; CONVERT_LIST *list_head; scanf("%d\n", &num); LOG("num = %d\n", num); if (num == 0) { break; } /* Make convert table */ for (i = 0; i < num; i++) { scanf("%c %c\n", &from, &to); LOG("from = %c, to = %c\n", from, to); list_head = insert_list(list_head, from, to); } /* Convert */ scanf("%d\n", &convert_num); LOG("convert_num = %d\n", convert_num); for (i = 0; i < convert_num; i++) { scanf("%c\n", &target); LOG("target = %c\n", target); printf("%c", search_list(list_head, target)); } printf("\n"); } return 0; } CONVERT_LIST* insert_list(CONVERT_LIST *list, char from, char to) { CONVERT_LIST *head, *tail, *new_node; head = tail = list; if (tail != NULL) { for ( ; tail->next != NULL ; tail = tail->next) { /* NOP */ } } new_node = (CONVERT_LIST*)malloc(sizeof(CONVERT_LIST)); if (new_node == NULL) { /* malloc failed */ return NULL; } memset(new_node, '\0', sizeof(CONVERT_LIST)); new_node->from = from; new_node->to = to; new_node->next = NULL; if (tail != NULL) { tail->next = new_node; } else { head = new_node; } return head; } char search_list(CONVERT_LIST *head, char target) { CONVERT_LIST *tmp; tmp = head; if (head == NULL) { return target; } for ( ; tmp != NULL ; tmp = tmp->next) { if (tmp->from == target) { return tmp->to; } } return target; }
main.c:7:6: error: #elif with no expression 7 | #elif | ^ main.c: In function 'main': main.c:33:9: error: implicit declaration of function 'LOG' [-Wimplicit-function-declaration] 33 | LOG("num = %d\n", num); | ^~~
s399499016
p00424
C
#include <cstdio> #include <vector> using namespace std; struct CODE { char before; char after; }; int main(void) { int n; while (scanf("%d", &n) * n != 0){ vector<CODE> code; vector<char> str; while (n-- > 0){ CODE c; scanf(" %c %c", &c.before, &c.after); code.push_back(c); } int m; scanf("%d", &m); while (m-- > 0){ char c; scanf(" %c", &c); for (int i = 0; i < code.size(); i++){ if (c == code[i].before){ c = code[i].after; break; } } str.push_back(c); } for (int i = 0; i < str.size(); i++){ putchar(str[i]); } puts(""); } return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s799654065
p00424
C++
use std::io; use std::str::FromStr; use std::collections::HashMap; fn read() -> i32 { let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); let x: i32 = s.trim().parse().unwrap(); x } fn read_char() -> String { let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); let x: String = s.trim().parse().unwrap(); x } fn main(){ loop{ let mut rules : HashMap<String,String> = HashMap::new(); let n = read(); if n == 0{ break; } for i in 0..n{ let mut buf = String::new(); io::stdin().read_line(&mut buf).unwrap(); let mut it = buf.split_whitespace().map(|n| String::from_str(n).unwrap()); let a = it.next().unwrap(); let b = it.next().unwrap(); rules.insert(a,b); } let m = read(); for i in 0..m{ let mut a = read_char(); match rules.get(&a){ Some(e) =>{ print!("{}",e); }, None => print!("{}",&a), } } println!(); } }
a.cc:26:18: error: too many decimal points in number 26 | for i in 0..n{ | ^~~~ a.cc:37:18: error: too many decimal points in number 37 | for i in 0..m{ | ^~~~ a.cc:1:1: error: 'use' does not name a type 1 | use std::io; | ^~~ a.cc:2:1: error: 'use' does not name a type 2 | use std::str::FromStr; | ^~~ a.cc:3:1: error: 'use' does not name a type 3 | use std::collections::HashMap; | ^~~ a.cc:5:1: error: 'fn' does not name a type 5 | fn read() -> i32 { | ^~ a.cc:11:1: error: 'fn' does not name a type 11 | fn read_char() -> String { | ^~ a.cc:18:2: error: 'fn' does not name a type 18 | fn main(){ | ^~
s141050624
p00424
C++
#include<iostream> using namespace std; int main() { int n, m; char c[200], a, b, p; while( cin >> n ) { if( n == 0 ) break; for( int i = 0; i < 200; i++ ) c[i] = '.'; for( int i = 0; i < n; i++ ) { cin >> a >> b; c[a] = b; } cin >> m; for( int i = 0; i < m; i++ ) { cin >> p[i]; if( c[p] == '.' ) cout << p; else cout << c[p]; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:25:21: error: invalid types 'char[int]' for array subscript 25 | cin >> p[i]; | ^
s509789709
p00424
C++
#include <cstdio> #include <map> using namespace std; int main() { int n, m; char before, after; map<char, char> conversion; int i; while (scanf("%d", &n) * n != 0){ conversion.clear(); for (i = 0; i < n; i++){ scanf(" %c %c", &before, &after); conversion[before] = after; } scanf("%d", &m); for (i = 0; i < m; i++){ scanf(" %c", &before); if (conversion.count(before)){ printf("%c", conversion[before]); } else { printf("%c", before); }<`0`> } puts(""); } return (0); }
a.cc:31:15: error: stray '`' in program 31 | }<`0`> | ^ a.cc:31:17: error: stray '`' in program 31 | }<`0`> | ^ a.cc: In function 'int main()': a.cc:31:14: error: expected primary-expression before '<' token 31 | }<`0`> | ^ a.cc:32:9: error: expected primary-expression before '}' token 32 | } | ^
s023458654
p00424
C++
#include<iostream> using namespace std; int main () { int n,i.m; char s[100000000]; char list[100][100]; while(cin >> n,n) { for(i=0;i<n;i++) { for(j=0;j<2;j++) cin >> list[i][j]; } cin >> m; for(i=0;i<m;i++) { cin >> s[i]; for(j=0;j<n;j++) { if(s[i] == list[j][1]){ s[i] = list[j][2]; break; } } } cout << s << endl; } }
a.cc: In function 'int main()': a.cc:5:8: error: expected initializer before '.' token 5 | int n,i.m; | ^ a.cc:9:9: error: 'i' was not declared in this scope 9 | for(i=0;i<n;i++) { | ^ a.cc:10:13: error: 'j' was not declared in this scope 10 | for(j=0;j<2;j++) | ^ a.cc:13:12: error: 'm' was not declared in this scope 13 | cin >> m; | ^ a.cc:14:9: error: 'i' was not declared in this scope 14 | for(i=0;i<m;i++) { | ^ a.cc:16:13: error: 'j' was not declared in this scope 16 | for(j=0;j<n;j++) { | ^
s883343709
p00424
C++
#include<iostream> using namespace std; int main () { int n,i.m; char s[100000000]; char list[100][100]; while(cin >> n,n) { for(i=0;i<n;i++) { for(j=0;j<2;j++) cin >> list[i][j]; } cin >> m; for(i=0;i<m;i++) { cin >> s[i]; for(j=0;j<n;j++) { if(s[i] == list[j][1]){ s[i] = list[j][2]; break; } } } for(i=0,i<s.sizeof(),i++) cout << s << endl; } }
a.cc: In function 'int main()': a.cc:5:8: error: expected initializer before '.' token 5 | int n,i.m; | ^ a.cc:9:9: error: 'i' was not declared in this scope 9 | for(i=0;i<n;i++) { | ^ a.cc:10:13: error: 'j' was not declared in this scope 10 | for(j=0;j<2;j++) | ^ a.cc:13:12: error: 'm' was not declared in this scope 13 | cin >> m; | ^ a.cc:14:9: error: 'i' was not declared in this scope 14 | for(i=0;i<m;i++) { | ^ a.cc:16:13: error: 'j' was not declared in this scope 16 | for(j=0;j<n;j++) { | ^ a.cc:23:5: error: 'i' was not declared in this scope 23 | for(i=0,i<s.sizeof(),i++) | ^ a.cc:23:13: error: expected unqualified-id before 'sizeof' 23 | for(i=0,i<s.sizeof(),i++) | ^~~~~~ a.cc:25:1: error: expected primary-expression before '}' token 25 | } | ^ a.cc:24:23: error: expected ';' before '}' token 24 | cout << s << endl; | ^ | ; 25 | } | ~ a.cc:25:1: error: expected primary-expression before '}' token 25 | } | ^ a.cc:24:23: error: expected ')' before '}' token 24 | cout << s << endl; | ^ | ) 25 | } | ~ a.cc:23:4: note: to match this '(' 23 | for(i=0,i<s.sizeof(),i++) | ^ a.cc:25:1: error: expected primary-expression before '}' token 25 | } | ^
s849953511
p00424
C++
#include<iostream> using namespace std; int main () { int n,i,j,m; char s[100000000]; char list[100][100]; while(cin >> n,n) { for(i=0;i<n;i++) { for(j=0;j<2;j++) cin >> list[i][j]; } cin >> m; for(i=0;i<m;i++) { cin >> s[i]; for(j=0;j<n;j++) { if(s[i] == list[j][1]){ s[i] = list[j][2]; break; } } } for(i=0;i<s.sizeof();i++) cout << s << endl; } }
a.cc: In function 'int main()': a.cc:23:13: error: expected unqualified-id before 'sizeof' 23 | for(i=0;i<s.sizeof();i++) | ^~~~~~ a.cc:23:13: error: expected ';' before 'sizeof' 23 | for(i=0;i<s.sizeof();i++) | ^~~~~~ | ; a.cc:23:20: error: expected primary-expression before ')' token 23 | for(i=0;i<s.sizeof();i++) | ^ a.cc:23:21: error: expected ')' before ';' token 23 | for(i=0;i<s.sizeof();i++) | ~ ^ | ) a.cc:23:25: error: expected ';' before ')' token 23 | for(i=0;i<s.sizeof();i++) | ^ | ;
s402953182
p00424
C++
#include<cstdio> #include<iostream> #include<vector> using namespace std; int main(void){ while (1){ int n; scanf_s("%d", &n); if (n == 0)return 0; vector<char> code1; vector<char> code2; for (int i = 0; i < n; i++){ char a, b; scanf_s(" %c", &a); scanf_s(" %c", &b); code1.push_back(a); code2.push_back(b); } int m; scanf_s("%d", &m); vector<char> ans; for (int i = 0; i < m; i++){ char a; scanf_s(" %c", &a); ans.push_back(a); for (int j = 0; j < n; j++){ if (ans[i] == code1[j]){ ans[i] = code2[j]; break; } } printf("%c", ans[i]); } printf("\n"); } }
a.cc: In function 'int main()': a.cc:10:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 10 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s864358903
p00424
C++
#include <iostream> #include <vector> #include <fstream> using namespace std; int main() { //ifstream cin("INPUT.txt"); //ofstream cout("OUTPUT.txt"); vector<char> before; vector<char> after; vector<char> str; int n, m, i, j; char c; while(cin >> n, n) { str.clear(); before.resize(n); after.resize(n); for(i = 0; i < n; i++) { cin >> before[i] >> after[i]; } cin >> m; for(i = 0; i < m; i++) { cin >> c; for(j = 0; j < n; j++){ if(c == before[j]) { c = after[j]; break; } } str.push_back(c); } str.push_back('\0'); cout << str << endl; } return 0; }
a.cc: In function 'int main()': a.cc:36:22: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>') 36 | cout << str << endl; | ~~~~ ^~ ~~~ | | | | | std::vector<char> | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<char>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::nullptr_t' 306 | operator<<(nullptr_t) | ^~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:124:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(
s618222043
p00424
C++
#include <iostream> #include <vector> #include <fstream> using namespace std; int main() { //ifstream cin("INPUT.txt"); //ofstream cout("OUTPUT.txt"); vector<char> before; vector<char> after; vector<char> str; int n, m, i, j; char c; while(cin >> n, n) { str.clear(); before.resize(n); after.resize(n); for(i = 0; i < n; i++) { cin >> before[i] >> after[i]; } cin >> m; for(i = 0; i < m; i++) { cin >> c; for(j = 0; j < n; j++){ if(c == before[j]) { c = after[j]; break; } } str.push_back(c); } str.push_back('\0'); cout << str << endl; } return 0; }
a.cc: In function 'int main()': a.cc:36:22: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>') 36 | cout << str << endl; | ~~~~ ^~ ~~~ | | | | | std::vector<char> | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<char>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::nullptr_t' 306 | operator<<(nullptr_t) | ^~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:124:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(
s990331358
p00424
C++
#include <iostream> #include <vector> #include <fstream> using namespace std; int main() { //ifstream cin("INPUT.txt"); //ofstream cout("OUTPUT.txt"); vector<char> before; vector<char> after; vector<char> str; int n, m, i, j; char c; while(cin >> n, n) { str.clear(); before.resize(n); after.resize(n); for(i = 0; i < n; i++) { cin >> before[i] >> after[i]; } cin >> m; for(i = 0; i < m; i++) { cin >> c; for(j = 0; j < n; j++){ if(c == before[j]) { c = after[j]; break; } } str.push_back(c); } str.push_back('\0'); cout << str << endl; } return 0; }
a.cc: In function 'int main()': a.cc:36:22: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>') 36 | cout << str << endl; | ~~~~ ^~ ~~~ | | | | | std::vector<char> | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<char>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::nullptr_t' 306 | operator<<(nullptr_t) | ^~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:124:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(
s184195054
p00424
C++
#include <iostream> #include <string> using namespace std; int main(){ string answers=""; // string tables=""; int number=0; while(1){ cin >> number; if(number==0){break;} string table=""; string answer=""; for (int i=0;i<number;i++){ string a,b; cin >> a >> b; table+=a+b; } tables+=table+ "\n"; cin >> number; for (int i=0;i<number;i++){ string a; cin >> a; for(int i=0;i<table.length()/2;i++){ if (table.substr(i*2,1)==a){ a=table.substr(i*2+1,1); break; } } answer+=a; } answers += answer+"\n"; } cout << answers ; // cout << tables ; return 0; }
a.cc: In function 'int main()': a.cc:21:17: error: 'tables' was not declared in this scope; did you mean 'table'? 21 | tables+=table+ "\n"; | ^~~~~~ | table
s549988436
p00424
C++
3 A a 0 5 5 4 10 A B C 0 1 4 5 a b A 3 A a 0 5 5 4 10 A B C 0 1 4 5 a b A 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3 | ^
s456306609
p00424
C++
#include<stdio.h> #include<string.h> #include<algorithm> #include<iostream> using namespace std; int main(void){ int n,m; char c[256],a,b; while(1){ scanf("%d",&n); if(n==0){break;} for(int i=0;i<256;i++){ c[i]=0; } for(int i=0;i<n;i++){ scanf("%c%c",&a,&b); c[a]=b; } scanf("%d",&m); for(int i=0;i<m;i++){ scanf("%c",&a); if(c[a]){printf("%c",a)} else{ printf("%c",f) } } printf("\n"); } return 0; }
a.cc: In function 'int main()': a.cc:24:24: error: expected ';' before '}' token 24 | if(c[a]){printf("%c",a)} | ^ | ; a.cc:25:19: error: 'f' was not declared in this scope 25 | else{ printf("%c",f) } | ^
s149364457
p00424
C++
#include<stdio.h> #include<string.h> #include<algorithm> #include<iostream> using namespace std; int main(void){ int n,m; char c[256],a,b; while(1){ scanf("%d",&n); if(n==0){break;} for(int i=0;i<256;i++){ c[i]=0; } for(int i=0;i<n;i++){ scanf("%c%c",&a,&b); c[a]=b; } scanf("%d",&m); for(int i=0;i<m;i++){ scanf("%c",&a); if(c[a]){printf("%c",a);} else{ printf("%c",f) ; } } printf("\n"); } return 0; }
a.cc: In function 'int main()': a.cc:25:19: error: 'f' was not declared in this scope 25 | else{ printf("%c",f) ; } | ^
s174117601
p00424
C++
#include<iostream> #include<math.h> #include<algorithm> #include<string> using namespace std; int n,m; string str; char c[256]; struct DATA{ string b,a; }; DATA data[256]; int main(){ while(1){ str=0; cin>>n; if(n==0){break;} for(int i=0;i<n;i++){ cin>>data[i].b>>data[i].a; } cin>>m; for(int i=0;i<m;i++){ cin>>c; if(data[i].b==c){str+=data[i].a;} else{str+=c;} } cout<<str<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:21: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 17 | str=0; | ^ In file included from /usr/include/c++/14/string:54, 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/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 817 | operator=(const basic_string& __str) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 828 | operator=(const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 840 | operator=(_CharT __c) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 858 | operator=(basic_string&& __str) | ^~~~~~~~ a.cc:21:30: error: reference to 'data' is ambiguous 21 | cin>>data[i].b>>data[i].a; | ^~~~ In file included from /usr/include/c++/14/string:53: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:13:6: note: 'DATA data [256]' 13 | DATA data[256]; | ^~~~ a.cc:21:41: error: reference to 'data' is ambiguous 21 | cin>>data[i].b>>data[i].a; | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:13:6: note: 'DATA data [256]' 13 | DATA data[256]; | ^~~~ a.cc:26:28: error: reference to 'data' is ambiguous 26 | if(data[i].b==c){str+=data[i].a;} | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:13:6: note: 'DATA data [256]' 13 | DATA data[256]; | ^~~~ a.cc:26:47: error: reference to 'data' is ambiguous 26 | if(data[i].b==c){str+=data[i].a;} | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:13:6: note: 'DATA data [256]' 13 | DATA data[256]; | ^~~~
s104210382
p00424
C++
#include<iostream> #include<math.h> #include<algorithm> #include<string> using namespace std; int n,m; string str; string c; struct DATA{ string b,a; }; DATA data[256]; int main(){ while(1){ str=0; cin>>n; if(n==0){break;} for(int i=0;i<n;i++){ cin>>data[i].b>>data[i].a; } cin>>m; for(int i=0;i<m;i++){ cin>>c; if(data[i].b==c){str+=data[i].a;} else{str+=c;} } cout<<str<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:21: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 17 | str=0; | ^ In file included from /usr/include/c++/14/string:54, 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/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 817 | operator=(const basic_string& __str) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 828 | operator=(const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 840 | operator=(_CharT __c) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 858 | operator=(basic_string&& __str) | ^~~~~~~~ a.cc:21:30: error: reference to 'data' is ambiguous 21 | cin>>data[i].b>>data[i].a; | ^~~~ In file included from /usr/include/c++/14/string:53: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:13:6: note: 'DATA data [256]' 13 | DATA data[256]; | ^~~~ a.cc:21:41: error: reference to 'data' is ambiguous 21 | cin>>data[i].b>>data[i].a; | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:13:6: note: 'DATA data [256]' 13 | DATA data[256]; | ^~~~ a.cc:26:28: error: reference to 'data' is ambiguous 26 | if(data[i].b==c){str+=data[i].a;} | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:13:6: note: 'DATA data [256]' 13 | DATA data[256]; | ^~~~ a.cc:26:47: error: reference to 'data' is ambiguous 26 | if(data[i].b==c){str+=data[i].a;} | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:13:6: note: 'DATA data [256]' 13 | DATA data[256]; | ^~~~
s277159487
p00424
C++
#include <iostream> #include <algorithm> using namespace std; #define for(i,a,b) for(int i=(a);i<(b);i++) #define rep(i,n) for(int i=0;i<(n);i++) int main() { int n, m; while(cin>>n,n){ char ts[256] = {}; rep(i, n) { char f, t; cin>>f>>t; ts[f]=t; } cin>>m; rep(i, m) { char w; cin>>w; cout<<ts[w]; } cout<<endl; } return 0; }
a.cc:14:25: error: macro "for" requires 3 arguments, but only 1 given 14 | rep(i, n) { | ^ a.cc:5:9: note: macro "for" defined here 5 | #define for(i,a,b) for(int i=(a);i<(b);i++) | ^~~ a.cc:20:25: error: macro "for" requires 3 arguments, but only 1 given 20 | rep(i, m) { | ^ a.cc:5:9: note: macro "for" defined here 5 | #define for(i,a,b) for(int i=(a);i<(b);i++) | ^~~ a.cc: In function 'int main()': a.cc:14:27: error: expected '(' before '{' token 14 | rep(i, n) { | ^ | ( a.cc:14:27: error: expected primary-expression before '{' token a.cc:6:18: error: expected primary-expression before 'for' 6 | #define rep(i,n) for(int i=0;i<(n);i++) | ^~~ a.cc:20:17: note: in expansion of macro 'rep' 20 | rep(i, m) { | ^~~ a.cc:19:24: error: expected ')' before 'for' 19 | cin>>m; | ^ | ) a.cc:14:27: note: to match this '(' 14 | rep(i, n) { | ^ a.cc:20:27: error: expected '(' before '{' token 20 | rep(i, m) { | ^ | ( a.cc:20:27: error: expected primary-expression before '{' token a.cc:26:9: error: expected primary-expression before '}' token 26 | } | ^ a.cc:25:28: error: expected ')' before '}' token 25 | cout<<endl; | ^ | ) 26 | } | ~ a.cc:20:27: note: to match this '(' 20 | rep(i, m) { | ^ a.cc:26:9: error: expected primary-expression before '}' token 26 | } | ^
s419734453
p00424
C++
#include <iostream> #include <algorithm> using namespace std; #define for(i,a,b) for(int i=(a);i<(b);i++) #define rep(i,n) for(int i=0;i<(n);i++) int main() { int n, m; while(cin>>n,n){ char ts[256] = {}; rep(i, n) { char f, t; cin>>f>>t; ts[f+0]=t; } cin>>m; rep(i, m) { char w; cin>>w; cout<<ts[w+0]; } cout<<endl; } return 0; }
a.cc:14:25: error: macro "for" requires 3 arguments, but only 1 given 14 | rep(i, n) { | ^ a.cc:5:9: note: macro "for" defined here 5 | #define for(i,a,b) for(int i=(a);i<(b);i++) | ^~~ a.cc:20:25: error: macro "for" requires 3 arguments, but only 1 given 20 | rep(i, m) { | ^ a.cc:5:9: note: macro "for" defined here 5 | #define for(i,a,b) for(int i=(a);i<(b);i++) | ^~~ a.cc: In function 'int main()': a.cc:14:27: error: expected '(' before '{' token 14 | rep(i, n) { | ^ | ( a.cc:14:27: error: expected primary-expression before '{' token a.cc:6:18: error: expected primary-expression before 'for' 6 | #define rep(i,n) for(int i=0;i<(n);i++) | ^~~ a.cc:20:17: note: in expansion of macro 'rep' 20 | rep(i, m) { | ^~~ a.cc:19:24: error: expected ')' before 'for' 19 | cin>>m; | ^ | ) a.cc:14:27: note: to match this '(' 14 | rep(i, n) { | ^ a.cc:20:27: error: expected '(' before '{' token 20 | rep(i, m) { | ^ | ( a.cc:20:27: error: expected primary-expression before '{' token a.cc:26:9: error: expected primary-expression before '}' token 26 | } | ^ a.cc:25:28: error: expected ')' before '}' token 25 | cout<<endl; | ^ | ) 26 | } | ~ a.cc:20:27: note: to match this '(' 20 | rep(i, m) { | ^ a.cc:26:9: error: expected primary-expression before '}' token 26 | } | ^
s198851930
p00424
C++
#include<iostream> #include<stdio.h> using namespace std; int ushi; int shika; char uma; int hiru; long char a[100000000]; long char b[100000000]; int main(){ cin >> ushi; for (int i = 0; i < ushi; i++){ cin >> a[i] >> b[i]; } cin >> shika; for (int j = 0; j < shika; j++){ cin >> uma; hiru = 0; for (int k = 0; k < ushi;k++){ if (uma == a[k]){ cout << b[k]; hiru = 1; } } if (hiru == 0){ cout << uma; } } cout << endl; }
a.cc:9:1: error: 'long' specified with 'char' 9 | long char a[100000000]; | ^~~~ a.cc:10:1: error: 'long' specified with 'char' 10 | long char b[100000000]; | ^~~~
s116897406
p00424
C++
#include<iostream> using namespace std; int main(){ int n=0; int m; int word; while(true){ cin>>n; if(n==0){ break; }else{ int transition[n*2]; for(int i=0;i<n*2;i++){ cin>>transition[i]>>transition>>[i+1]; } cin>>m; for(int i=0;i<m;i++){ cin>>word; for(int j=0;j<n*2;j+=2){ if(word==transition[j]){ word=transition[j+1]; } } cout<<word; } cout<<'\n'; } } return 0; }
a.cc: In function 'int main()': a.cc:15:23: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int [(n * 2)]') 15 | cin>>transition[i]>>transition>>[i+1]; | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ | | | | | int [(n * 2)] | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*' 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'short int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(short int)((int*)(& transition))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(short unsigned int)((int*)(& transition))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(int)((int*)(& transition))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(unsigned int)((int*)(& transition))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long int)((int*)(& transition))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long unsigned int)((int*)(& transition))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long long int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long long int)((int*)(& transition))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long long unsigned int)((int*)(& transition))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /u
s848608394
p00424
C++
#include<iostream> using namespace std; int main(){ int n=0; int m; int word; while(true){ cin>>n; if(n==0){ break; }else{ int transition[n*2]; for(int i=0;i<n*2;i++){ cin>>transition[i]>>transition>>[i+1]; } cin>>m; for(int i=0;i<m;i++){ cin>>word; for(int j=0;j<n*2;j+=2){ if(word==transition[j]){ word=transition[j+1]; } } cout<<word; } cout<<'\n'; } } return 0; }
a.cc: In function 'int main()': a.cc:15:23: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int [(n * 2)]') 15 | cin>>transition[i]>>transition>>[i+1]; | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ | | | | | int [(n * 2)] | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*' 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'short int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(short int)((int*)(& transition))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(short unsigned int)((int*)(& transition))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(int)((int*)(& transition))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(unsigned int)((int*)(& transition))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long int)((int*)(& transition))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long unsigned int)((int*)(& transition))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long long int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long long int)((int*)(& transition))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long long unsigned int)((int*)(& transition))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /u
s013600789
p00424
C++
#include<iostream> using namespace std; int main(){ long int n=0; long int m; char word; while(true){ cin>>n; if(n==0){ break; }else{ int transition[n*2]; for(int i=0;i<n*2;i++){ cin>>transition[i]>>transition>>[i+1]; } cin>>m; for(int i=0;i<m;i++){ cin>>word; for(int j=0;j<n*2;j+=2){ if(word==transition[j]){ word=transition[j+1]; } } cout<<word; } cout<<'\n'; } } return 0; }
a.cc: In function 'int main()': a.cc:15:23: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int [(n * 2)]') 15 | cin>>transition[i]>>transition>>[i+1]; | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ | | | | | int [(n * 2)] | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*' 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'short int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(short int)((int*)(& transition))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(short unsigned int)((int*)(& transition))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(int)((int*)(& transition))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(unsigned int)((int*)(& transition))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long int)((int*)(& transition))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long unsigned int)((int*)(& transition))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long long int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long long int)((int*)(& transition))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive] 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ | | | int* a.cc:15:25: error: cannot bind rvalue '(long long unsigned int)((int*)(& transition))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:15:25: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 15 | cin>>transition[i]>>transition>>[i+1]; | ^~~~~~~~~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [(n * 2)]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /u
s796275266
p00424
C++
#include,iostream> using namespace std; char T[25000][2]; char S; int main(){ int n,m; while(true){ cin>>n; if(n==0){ break; } for(int i-0;i<n;i++){ cin>>T[i][0]>>T[i][1]; } cin>>m; for(int i=0;i<m;i++){ cin>>S; for(int j=0;j<n;j++){ if(T[j][0]==S){ cout<<T[j][1]; goto Exit; } } cout<<S; Exit:; } cout<<endl; } }
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include,iostream> | ^ a.cc: In function 'int main()': a.cc:9:1: error: 'cin' was not declared in this scope 9 | cin>>n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #include,iostream> a.cc:13:10: error: expected ';' before '-' token 13 | for(int i-0;i<n;i++){ | ^ | ; a.cc:13:16: error: expected ')' before ';' token 13 | for(int i-0;i<n;i++){ | ~ ^ | ) a.cc:13:17: error: 'i' was not declared in this scope 13 | for(int i-0;i<n;i++){ | ^ a.cc:21:9: error: 'cout' was not declared in this scope 21 | cout<<T[j][1]; | ^~~~ a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:25:1: error: 'cout' was not declared in this scope 25 | cout<<S; | ^~~~ a.cc:25:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:1: error: 'cout' was not declared in this scope 28 | cout<<endl; | ^~~~ a.cc:28:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:28:7: error: 'endl' was not declared in this scope 28 | cout<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #include,iostream>
s198786352
p00424
C++
#include<iostream> using namespace std; int main(){ int a, mozi; cin >> a ; int wrong[a], right[a]; for(int i=0; i < a; i++){ cin >> wrong[i] >> right[i]; } cin >> mozi; int mozire[mozi]; for(int j=0; j < mozi; j++){ cin >> mozire[j]; for(int f=0; f < a; f++) if(mozire[j] == wrong[f]) mozire[j] = right[f]; } for(int e = 0; e < mozi; e++) cout << mozire[e]; cout << stdl; return 0; }
a.cc: In function 'int main()': a.cc:24:10: error: 'stdl' was not declared in this scope; did you mean 'std'? 24 | cout << stdl; | ^~~~ | std
s127979814
p00424
C++
#include <cstdio> int main(){ char key,val,table[256]; int n,m,i,d; scanf("%d",&n); while(n>0){ for(i=0;i<256;i++) table[i]=i; for(i=0;i<n;k++){ scanf("%c %c",&key,&val); table[key]=val; }; scanf("%d",&m); for(i=0;i<m;i++){ scanf("%c",&d); printf("%c",table[d]); } printf("\n"); scanf("%d",&n); }; return 0; }:
a.cc: In function 'int main()': a.cc:8:15: error: 'k' was not declared in this scope 8 | for(i=0;i<n;k++){ | ^ a.cc: At global scope: a.cc:21:2: error: expected unqualified-id before ':' token 21 | }: | ^
s415516930
p00424
C++
#include <cstdio> int main(){ char key,val,table[256]; int n,m,i; char d; scanf("%d",&n); while(n>0){ for(i=0;i<256;i++) table[i]=i; for(i=0;i<n;k++){ scanf("%c %c",&key,&val); table[key]=val; }; scanf("%d",&m); for(i=0;i<m;i++){ scanf("%c",&d); printf("%c",table[d]); } printf("\n"); scanf("%d",&n); }; return 0; }:
a.cc: In function 'int main()': a.cc:9:15: error: 'k' was not declared in this scope 9 | for(i=0;i<n;k++){ | ^ a.cc: At global scope: a.cc:22:2: error: expected unqualified-id before ':' token 22 | }: | ^
s383812352
p00424
C++
Can't find usable .clang-format, using LLVM style Can't find usable .clang-format, using LLVM style #include <bits/stdc++.h> using namespace std; char n1[100001], m[100001]; char n2[100001]; int main() { int N, M; while (1) { scanf("%d", &N); if (N == 0) break; for (int i = 0; i < N; i++) { scanf("%s %s", &n1[i], &n2[i]); } printf("hoge\n"); scanf("%d", &M); for (int i = 0; i < M; i++) { scanf("%s", &m[i]); bool flag; int j; for (j = 0; j < N; j++) { if (n1[j] == m[i]) { flag = true; break; } else flag = false; } if (flag) m[i] = n2[j]; } printf("%s\n", m); } return 0; }
a.cc:1:4: warning: missing terminating ' character 1 | Can't find usable .clang-format, using LLVM style | ^ a.cc:1:4: error: missing terminating ' character 1 | Can't find usable .clang-format, using LLVM style | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:2:4: warning: missing terminating ' character 2 | Can't find usable .clang-format, using LLVM style | ^ a.cc:2:4: error: missing terminating ' character 2 | Can't find usable .clang-format, using LLVM style | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:1:1: error: 'Can' does not name a type 1 | Can't find usable .clang-format, using LLVM style | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:3: /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'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) 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:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) 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)> | ^~~~~~ /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; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /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/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/inclu
s534709790
p00424
C++
#include <unordered_map> #include <iostream> using namespace std; int main() { unordered_map<char, char> mp; char a,b,c,d[100000]; string x; int n; do{ cin >> n; do{ cin >> a >> b; mp[a] = b; } while (--n); cin >> n; do{ cin >> c; if (mp[c] != NULL) { x += mp[c]; } else { x += c; } } while (--n); strcpy_s(d, x.c_str()); cout << d << endl; } while (c != 0); return 0; }
a.cc: In function 'int main()': a.cc:22:38: warning: NULL used in arithmetic [-Wpointer-arith] 22 | if (mp[c] != NULL) { | ^~~~ a.cc:29:17: error: 'strcpy_s' was not declared in this scope 29 | strcpy_s(d, x.c_str()); | ^~~~~~~~
s790377654
p00424
C++
#include <unordered_map> #include <iostream> using namespace std; int main() { unordered_map<char, char> mp; char a,b,c,d[100000]; string x; int n; do{ cin >> n; do{ cin >> a >> b; mp[a] = b; } while (--n); cin >> n; do{ cin >> c; if (mp[c] != NULL) { x += mp[c]; } else { x += c; } } while (--n); strcpy_s(d, x.c_str()); cout << d << endl; } while (c != 0); return 0; }
a.cc: In function 'int main()': a.cc:22:38: warning: NULL used in arithmetic [-Wpointer-arith] 22 | if (mp[c] != NULL) { | ^~~~ a.cc:29:17: error: 'strcpy_s' was not declared in this scope 29 | strcpy_s(d, x.c_str()); | ^~~~~~~~
s109283921
p00424
C++
#include <map> #include <iostream> using namespace std; int main() { map<char, char> mp; char a,b,c,d[100000]; string x; int n; do{ cin >> n; do{ cin >> a >> b; mp[a] = b; } while (--n); cin >> n; do{ cin >> c; if (mp[c] != NULL) { x += mp[c]; } else { x += c; } } while (--n); strcpy_s(d, x.c_str()); cout << d << endl; } while (c != 0); return 0; }
a.cc: In function 'int main()': a.cc:22:38: warning: NULL used in arithmetic [-Wpointer-arith] 22 | if (mp[c] != NULL) { | ^~~~ a.cc:29:17: error: 'strcpy_s' was not declared in this scope 29 | strcpy_s(d, x.c_str()); | ^~~~~~~~
s783779625
p00424
C++
#include <map> #include <iostream> using namespace std; int main() { map<char, char> mp; char a,b,c,d[100000]; string x; int n; do{ cin >> n; do{ cin >> a >> b; mp[a] = b; } while (--n); cin >> n; do{ cin >> c; if (mp[c] != NULL) { x += mp[c]; } else { x += c; } } while (--n); strcpy_s(d, x.c_str()); cout << d << endl; } while (c != 0); return 0; }
a.cc: In function 'int main()': a.cc:22:38: warning: NULL used in arithmetic [-Wpointer-arith] 22 | if (mp[c] != NULL) { | ^~~~ a.cc:29:17: error: 'strcpy_s' was not declared in this scope 29 | strcpy_s(d, x.c_str()); | ^~~~~~~~
s775985643
p00424
C++
#include <map> #include <iostream> using namespace std; int main() { map<char, char> mp; char a,b,c,d[100000]; string x; int n; do{ cin >> n; do{ cin >> a >> b; mp[a] = b; } while (--n); cin >> n; do{ cin >> c; if (mp[c] != NULL) { x += mp[c]; } else { x += c; } } while (--n); strcpy(d, x.c_str()); cout << d << endl; } while (c != 0); return 0; }
a.cc: In function 'int main()': a.cc:22:38: warning: NULL used in arithmetic [-Wpointer-arith] 22 | if (mp[c] != NULL) { | ^~~~ a.cc:29:17: error: 'strcpy' was not declared in this scope 29 | strcpy(d, x.c_str()); | ^~~~~~ a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostream> +++ |+#include <cstring> 3 |
s345473890
p00424
C++
#include <map> #include <iostream> #include <cstdlib> using namespace std; int main() { map<char, char> mp; char a,b,c,d[100000]; string x; int n; do{ cin >> n; do{ cin >> a >> b; mp[a] = b; } while (--n); cin >> n; do{ cin >> c; if (mp[c] != NULL) { x += mp[c]; } else { x += c; } } while (--n); strcpy(d, x.c_str()); cout << d << endl; } while (c != 0); return 0; }
a.cc: In function 'int main()': a.cc:22:38: warning: NULL used in arithmetic [-Wpointer-arith] 22 | if (mp[c] != NULL) { | ^~~~ a.cc:29:17: error: 'strcpy' was not declared in this scope 29 | strcpy(d, x.c_str()); | ^~~~~~ a.cc:4:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <cstdlib> +++ |+#include <cstring> 4 | using namespace std;
s951612569
p00424
C++
#include <map> #include <iostream> #include <string> using namespace std; int main() { map<char, char> mp; char a,b,c,d[100000]; string x; int n; do{ cin >> n; do{ cin >> a >> b; mp[a] = b; } while (--n); cin >> n; do{ cin >> c; if (mp[c] != NULL) { x += mp[c]; } else { x += c; } } while (--n); strcpy(d, x.c_str()); cout << d << endl; } while (c != 0); return 0; }
a.cc: In function 'int main()': a.cc:22:38: warning: NULL used in arithmetic [-Wpointer-arith] 22 | if (mp[c] != NULL) { | ^~~~ a.cc:29:17: error: 'strcpy' was not declared in this scope 29 | strcpy(d, x.c_str()); | ^~~~~~ a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostream> +++ |+#include <cstring> 3 | #include <string>
s949663354
p00424
C++
#include <iostream> using namespace std; int main(){ int n = 0 while(cin >> n && n){ int m = 0, henkan[10000] = {}; char in, iin; for(int i = 0; i < n; i++){ cin >> in >> iin; int ctoi = in, ctoii = iin; henkan[ctoi] = ctoii; } cin >> m; for(int i = 0; i < m; i++){ cin >> in; int ctoi = in; if(henkan[ctoi]) ctoi = henkan[ctoi]; cout << (char)ctoi; } cout << endl; } }
a.cc: In function 'int main()': a.cc:6:9: error: expected ',' or ';' before 'while' 6 | while(cin >> n && n){ | ^~~~~
s876020049
p00424
C++
include <bits/stdc++.h> #define REP(i, max) for(int i = 0, iMax = max; i < iMax; i ++) using namespace std; int main(int args, char **ppArgs) { map<char, char> conversionMap; // Input conversion tables int numTables; while(::scanf("%d", &numTables), numTables) { char from, to; REP(i, numTables) cin >> from >> to, conversionMap[from] = to; // Input text int textLen; ::scanf("%d", &textLen); string text(textLen, 0); REP(i, text.size()) { char ch; cin >> ch; text[i] = conversionMap.count(ch) ? conversionMap[ch] : ch; } ::puts(text.c_str()); } }
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main(int, char**)': a.cc:8:9: error: 'map' was not declared in this scope 8 | map<char, char> conversionMap; | ^~~ a.cc:8:13: error: expected primary-expression before 'char' 8 | map<char, char> conversionMap; | ^~~~ a.cc:12:17: error: '::scanf' has not been declared 12 | while(::scanf("%d", &numTables), numTables) | ^~~~~ a.cc:15:41: error: 'cin' was not declared in this scope 15 | REP(i, numTables) cin >> from >> to, conversionMap[from] = to; | ^~~ a.cc:15:65: error: 'conversionMap' was not declared in this scope 15 | REP(i, numTables) cin >> from >> to, conversionMap[from] = to; | ^~~~~~~~~~~~~ a.cc:19:19: error: '::scanf' has not been declared 19 | ::scanf("%d", &textLen); | ^~~~~ a.cc:20:17: error: 'string' was not declared in this scope 20 | string text(textLen, 0); | ^~~~~~ a.cc:21:24: error: 'text' was not declared in this scope; did you mean 'textLen'? 21 | REP(i, text.size()) | ^~~~ a.cc:3:47: note: in definition of macro 'REP' 3 | #define REP(i, max) for(int i = 0, iMax = max; i < iMax; i ++) | ^~~ a.cc:24:25: error: 'cin' was not declared in this scope 24 | cin >> ch; | ^~~ a.cc:25:35: error: 'conversionMap' was not declared in this scope 25 | text[i] = conversionMap.count(ch) ? conversionMap[ch] : ch; | ^~~~~~~~~~~~~ a.cc:27:19: error: '::puts' has not been declared 27 | ::puts(text.c_str()); | ^~~~ a.cc:27:24: error: 'text' was not declared in this scope; did you mean 'textLen'? 27 | ::puts(text.c_str()); | ^~~~ | textLen
s282653019
p00424
C++
//#include <bits/stdc++.h> #include <cstdio> #include <iostream> #include <map> #include <string> using namespace std; #define REP(i, max) for(int i = 0, iMax = max; i < iMax; i ++) #define MAX_TEXT_LEN 1e+5 int main(int args, char **ppArgs) { int numTables; while(::scanf("%d", &numTables), numTables) { // Input conversion tables map<char, char> conversionMap; // DO NOT FORGET TO RESET!! char from, to; REP(i, numTables) cin >> from >> to, conversionMap[from] = to; // Input text int textLen; ::scanf("%d", &textLen); char text[MAX_TEXT_LEN]; // string text(textLen, 0); REP(i, textLen) { char ch; cin >> ch; text[i] = conversionMap.count(ch) ? conversionMap[ch] : ch; } //::puts(text.c_str()); text[textLen] = 0; ::puts(text); } }
a.cc: In function 'int main(int, char**)': a.cc:10:25: error: conversion from 'double' to 'long unsigned int' in a converted constant expression 10 | #define MAX_TEXT_LEN 1e+5 | ^~~~ a.cc:26:27: note: in expansion of macro 'MAX_TEXT_LEN' 26 | char text[MAX_TEXT_LEN]; | ^~~~~~~~~~~~ a.cc:10:25: error: could not convert '1.0e+5' from 'double' to 'long unsigned int' 10 | #define MAX_TEXT_LEN 1e+5 | ^~~~ | | | double a.cc:26:27: note: in expansion of macro 'MAX_TEXT_LEN' 26 | char text[MAX_TEXT_LEN]; | ^~~~~~~~~~~~ a.cc:10:25: error: size of array 'text' has non-integral type 'double' 10 | #define MAX_TEXT_LEN 1e+5 | ^~~~ a.cc:26:27: note: in expansion of macro 'MAX_TEXT_LEN' 26 | char text[MAX_TEXT_LEN]; | ^~~~~~~~~~~~
s254291934
p00424
C++
#include<iostream> #include<vector> int main() { int n,N; std::cin >> n; std::vector<char>a(n),b(n); for (int i = 0; i < n; i += 1) std::cin >> a[i] >> b[i]; std::cin >> N; std::vector<char>c(N); for (int i = 0; i < N; i += 1) { std::cin >> c[i]; for (int j = 0; j < n; j += 1) { if (c[i] == a[j]) c[i] = b[j]; break; } } for (int i = 0; i < N; i += 1) std::cout << c[i]; return 0;
a.cc: In function 'int main()': a.cc:21:18: error: expected '}' at end of input 21 | return 0; | ^ a.cc:3:12: note: to match this '{' 3 | int main() { | ^
s458918444
p00424
C++
int main(){ int c[256]; int a; while(1){ scanf("%d",&a); if(a==0)return 0; for(int i=0;i<256;i++)c[i]=i; getchar(); getchar(); for(int i=0;i<a;i++){ char b,d; b=getchar(); getchar(); d=getchar(); getchar(); getchar(); c[b]=d; } int e; scanf("%d",&e); getchar(); getchar(); char f; for(int i=0;i<e;i++){ f=getchar(); getchar(); getchar(); putchar(c[(int)f]); } printf("\n"); } }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf' was not declared in this scope 5 | scanf("%d",&a); | ^~~~~ a.cc:8:9: error: 'getchar' was not declared in this scope 8 | getchar(); | ^~~~~~~ a.cc:1:1: note: 'getchar' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main(){ a.cc:28:13: error: 'putchar' was not declared in this scope; did you mean 'char'? 28 | putchar(c[(int)f]); | ^~~~~~~ | char a.cc:30:9: error: 'printf' was not declared in this scope 30 | printf("\n"); | ^~~~~~ a.cc:30:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s823420942
p00424
C++
#include <map> using namespace std; int main(){ for(;;){ map<char, char>m; int n, i, j; char ca, cb; scanf("%d", &n); if(n==0) break; for(i=0; i<n; i++){ scanf("%c %c", &ca, &cb); m[ca] = cb; } scanf("%d", &j); for(i=0; i<j; i++){ char c; scanf("%c", &c); auto itr = m.find(c); if(itr != m.end()) printf("%c", m[c]); else printf("%c", c); } puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'scanf' was not declared in this scope 8 | scanf("%d", &n); | ^~~~~ a.cc:19:32: error: 'printf' was not declared in this scope 19 | if(itr != m.end()) printf("%c", m[c]); | ^~~~~~ a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 1 | #include <map> +++ |+#include <cstdio> 2 | using namespace std; a.cc:20:18: error: 'printf' was not declared in this scope 20 | else printf("%c", c); | ^~~~~~ a.cc:20:18: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc:22:9: error: 'puts' was not declared in this scope 22 | puts(""); | ^~~~
s245682706
p00424
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)<<endl; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define INF 1<<25 #define pb push_back typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vd; typedef pair<int, int> pii; typedef pair<long, long> pll; typedef long long ll; int main() { int n; while (scanf("%d", &n), n) { char m[128], a, b; REP(i, 0, 128) m[i] = i; REP(i, 0, n) { scanf("%c %c", &a, &b); m[a] = b; } scanf("%d", &n ); REP(i, 0, n){ scanf("%c", &a); purchar(m[a]); } puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:51:13: error: 'purchar' was not declared in this scope; did you mean 'putchar'? 51 | purchar(m[a]); | ^~~~~~~ | putchar
s324838143
p00424
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)<<endl; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define INF 1<<25 #define pb push_back typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vd; typedef pair<int, int> pii; typedef pair<long, long> pll; typedef long long ll; int main() { int n; while (scanf("%d", &n), n) { char m[128], a, b; REP(i, 0, 128) m[i] = i; REP(i, 0, n) { scanf("%c %c", &a, &b); m[a] = b; } scanf("%d", &n ); REP(i, 0, n){ scanf("%c", &a); purchar(m[a]); } puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:51:13: error: 'purchar' was not declared in this scope; did you mean 'putchar'? 51 | purchar(m[a]); | ^~~~~~~ | putchar
s718253771
p00424
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)<<endl; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define INF 1<<25 #define pb push_back typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vd; typedef pair<int, int> pii; typedef pair<long, long> pll; typedef long long ll; int main() { int n; while (scanf("%d", &n), n) { char m[128], a, b; REP(i, 0, 128) m[i] = i; REP(i, 0, n) { scanf("%c %c", &a, &b); m[a] = b; } scanf("%d", &n ); REP(i, 0, n){ scanf("%c", &a); purchar(m[a]); } puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:51:13: error: 'purchar' was not declared in this scope; did you mean 'putchar'? 51 | purchar(m[a]); | ^~~~~~~ | putchar
s431708999
p00424
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)<<endl; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define INF 1<<25 #define pb push_back typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vd; typedef pair<int, int> pii; typedef pair<long, long> pll; typedef long long ll; int main() { int n; while (scanf("%d", &n), n) { char m[128], a, b; REP(i, 0, 128) m[i] = i; REP(i, 0, n) { scanf("%c %c", &a, &b); m[a] = b; } scanf("%d", &n ); REP(i, 0, n){ scanf("%c", &a); purchar(m[a]); } puts(""); } return 0; }
a.cc: In function 'int main()': a.cc:51:13: error: 'purchar' was not declared in this scope; did you mean 'putchar'? 51 | purchar(m[a]); | ^~~~~~~ | putchar
s136422021
p00424
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)<<endl; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define INF 1<<25 #define pb push_back typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vd; typedef pair<int, int> pii; typedef pair<long, long> pll; typedef long long ll; int main() { int n; while(scanf("%d ",&n), n){ char m[128],a,b; REP(i,128) m[i] = i; REP(i,n){ scanf("%c %c ",&a,&b); m[a] = b; } scanf("%d ",&n); REP(i,n){ scanf("%c ",&a); putchar(m[a]); } puts(""); } return 0; }
a.cc:43:14: error: macro "REP" requires 3 arguments, but only 2 given 43 | REP(i,128) m[i] = i; | ^ a.cc:25:9: note: macro "REP" defined here 25 | #define REP(i, x, n) for(int i = x; i < n; i++) | ^~~ a.cc:44:12: error: macro "REP" requires 3 arguments, but only 2 given 44 | REP(i,n){ | ^ a.cc:25:9: note: macro "REP" defined here 25 | #define REP(i, x, n) for(int i = x; i < n; i++) | ^~~ a.cc:49:12: error: macro "REP" requires 3 arguments, but only 2 given 49 | REP(i,n){ | ^ a.cc:25:9: note: macro "REP" defined here 25 | #define REP(i, x, n) for(int i = x; i < n; i++) | ^~~ a.cc: In function 'int main()': a.cc:43:5: error: 'REP' was not declared in this scope 43 | REP(i,128) m[i] = i; | ^~~ a.cc:44:8: error: expected ';' before '{' token 44 | REP(i,n){ | ^ ~ | ; a.cc:49:8: error: expected ';' before '{' token 49 | REP(i,n){ | ^ ~ | ;
s889442466
p00424
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)<<endl; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define INF 1<<25 #define pb push_back typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vd; typedef pair<int, int> pii; typedef pair<long, long> pll; typedef long long ll; int main() { int n; while(scanf("%d ",&n), n){ char m[128],a,b; REP(i,128) m[i] = i; REP(i,n){ scanf("%c %c ",&a,&b); m[a] = b; } scanf("%d ",&n); REP(i,n){ scanf("%c ",&a); putchar(m[a]); } puts(""); } return 0; }
a.cc:43:14: error: macro "REP" requires 3 arguments, but only 2 given 43 | REP(i,128) m[i] = i; | ^ a.cc:25:9: note: macro "REP" defined here 25 | #define REP(i, x, n) for(int i = x; i < n; i++) | ^~~ a.cc:44:12: error: macro "REP" requires 3 arguments, but only 2 given 44 | REP(i,n){ | ^ a.cc:25:9: note: macro "REP" defined here 25 | #define REP(i, x, n) for(int i = x; i < n; i++) | ^~~ a.cc:49:12: error: macro "REP" requires 3 arguments, but only 2 given 49 | REP(i,n){ | ^ a.cc:25:9: note: macro "REP" defined here 25 | #define REP(i, x, n) for(int i = x; i < n; i++) | ^~~ a.cc: In function 'int main()': a.cc:43:5: error: 'REP' was not declared in this scope 43 | REP(i,128) m[i] = i; | ^~~ a.cc:44:8: error: expected ';' before '{' token 44 | REP(i,n){ | ^ ~ | ; a.cc:49:8: error: expected ';' before '{' token 49 | REP(i,n){ | ^ ~ | ;
s398881672
p00424
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<ctime> #include<cctype> #include<climits> #include<iostream> #include<string> #include<vector> #include<map> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<memory> #include<functional> using namespace std; #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define F(i,j,k) fill(i[0],i[0]+j*j,k) #define P(p) cout<<(p)<<endl; #define EXIST(s,e) ((s).find(e)!=(s).end()) #define INF 1<<25 #define pb push_back typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vd; typedef pair<int, int> pii; typedef pair<long, long> pll; typedef long long ll; int main() { int n; while(scanf("%d ",&n), n){ char m[128],a,b; REP(i,128) m[i] = i; REP(i,n){ scanf("%c %c ",&a,&b); m[a] = b; } scanf("%d ",&n); REP(i,n){ scanf("%c ",&a); putchar(m[a]); } puts(""); } return 0; }
a.cc:43:14: error: macro "REP" requires 3 arguments, but only 2 given 43 | REP(i,128) m[i] = i; | ^ a.cc:25:9: note: macro "REP" defined here 25 | #define REP(i, x, n) for(int i = x; i < n; i++) | ^~~ a.cc:44:12: error: macro "REP" requires 3 arguments, but only 2 given 44 | REP(i,n){ | ^ a.cc:25:9: note: macro "REP" defined here 25 | #define REP(i, x, n) for(int i = x; i < n; i++) | ^~~ a.cc:49:12: error: macro "REP" requires 3 arguments, but only 2 given 49 | REP(i,n){ | ^ a.cc:25:9: note: macro "REP" defined here 25 | #define REP(i, x, n) for(int i = x; i < n; i++) | ^~~ a.cc: In function 'int main()': a.cc:43:5: error: 'REP' was not declared in this scope 43 | REP(i,128) m[i] = i; | ^~~ a.cc:44:8: error: expected ';' before '{' token 44 | REP(i,n){ | ^ ~ | ; a.cc:49:8: error: expected ';' before '{' token 49 | REP(i,n){ | ^ ~ | ;
s766523410
p00424
C++
def main(): aaa = {} str = "" while 1: n = int(input()) if not n: break for _ in range(n): INPUT = input().split() aaa[INPUT[0]] = INPUT[1] n = int(input()) if not n: break for _ in range(n): a = input() str += aaa[a]if a in aaa else a print(str) aaa = {} str = "" return 0 if __name__ == "__main__": main()
a.cc:1:1: error: 'def' does not name a type 1 | def main(): | ^~~ a.cc:3:5: error: 'str' does not name a type 3 | str = "" | ^~~ a.cc:19:9: error: 'str' does not name a type 19 | str = "" | ^~~
s959736962
p00424
C++
#include<iostream> #include<map> using namespace std; int main(){ while(true){ int n = 0; n << cin; if(n == 0){ break; } for(int i = 0; i < n; i++){ map<char, char> convert; char key, value; key << cin; value << cin; map[key] = value; } int m = 0; m << cin; for(int i = 0; i < m; i++){ char val; val << cin; if(convert.find(val) == convert.end()){ cout << convert[val]; }else{ cout << val; } } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:7: error: no match for 'operator<<' (operand types are 'int' and 'std::istream' {aka 'std::basic_istream<char>'}) 8 | n << cin; | ~ ^~ ~~~ | | | | int std::istream {aka std::basic_istream<char>} a.cc:8:7: note: candidate: 'operator<<(int, int)' (built-in) 8 | n << cin; | ~~^~~~~~ a.cc:8:7: note: no known conversion for argument 2 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, 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/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 8 | n << cin; | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:8:5: note: cannot convert 'n' (type 'int') to type 'std::byte' 8 | n << cin; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 8 | n << cin; | ^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:8:10: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int' 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = int&; _Tp = std::basic_istream<char>]': a.cc:8:10: required from here 8 | n << cin; | ^~~ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:15:11: error: no match for 'operator<<' (operand types are 'char' and 'std::istream' {aka 'std::basic_istream<char>'}) 15 | key << cin; value << cin; | ~~~ ^~ ~~~ | | | | char std::istream {aka std::basic_istream<char>} a.cc:15:11: note: candidate: 'operator<<(int, int)' (built-in) 15 | key << cin; value << cin; | ~~~~^~~~~~ a.cc:15:11: note: no known conversion for argument 2 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:15:14: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'char' 15 | key << cin; value << cin; | ^~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_o
s297728604
p00424
C++
#include<iostream> #include<map> using namespace std; int main(){ while(true){ int n = 0; cin >> n; if(n == 0){ break; } for(int i = 0; i < n; i++){ map<char, char> convert; char key, value; cin >> key; cin >> value; map[key] = value; } int m = 0; cin >> m; for(int i = 0; i < m; i++){ char val; cin >> val if(convert.find(val) == convert.end()){ cout << convert[val]; }else{ cout << val; } } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:11: error: conflicting declaration 'auto key' 16 | map[key] = value; | ^~~ a.cc:14:12: note: previous declaration as 'char key' 14 | char key, value; | ^~~ a.cc:22:17: error: expected ';' before 'if' 22 | cin >> val | ^ | ; 23 | if(convert.find(val) == convert.end()){ | ~~ a.cc:25:8: error: 'else' without a previous 'if' 25 | }else{ | ^~~~
s343165665
p00424
C++
#include<iostream> #include<map> using namespace std; int main(){ while(true){ int n = 0; cin >> n; if(n == 0){ break; } for(int i = 0; i < n; i++){ map<char, char> convert; char key, value; cin >> key; cin >> value; convert[key] = value; } int m = 0; cin >> m; for(int i = 0; i < m; i++){ char val; cin >> val; if(convert.find(val) == convert.end()){ cout << convert[val]; }else{ cout << val; } } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:23:10: error: 'convert' was not declared in this scope; did you mean 'const'? 23 | if(convert.find(val) == convert.end()){ | ^~~~~~~ | const
s645730602
p00424
C++
#include <iostream> #include <vector> using namespace std; int main() { int n, m; //n??????????????????????´???°???m?????????????±??????° char temp; while(cin >> n, n != 0){ vector<char> before, after; //???????????????????????¨????????????????????? for(int i=0; i<n; ++i){ cin >> temp; before.push_back(temp); cin >> temp; after.push_back(temp); } cin >> m; for(int i=0; i<m; ++i){ cin >> temp; if(find(befor.begin(), before.end(), temp) == before.end()){ //??????????????? cout << temp; //???????????? } else{ cout << after[find(before.begin(), before.end(), temp)]; } } cout << "\n"; //?????? } }
a.cc: In function 'int main()': a.cc:21:15: error: 'befor' was not declared in this scope; did you mean 'before'? 21 | if(find(befor.begin(), before.end(), temp) == before.end()){ //??????????????? | ^~~~~ | before a.cc:25:27: error: no matching function for call to 'find(std::vector<char>::iterator, std::vector<char>::iterator, char&)' 25 | cout << after[find(before.begin(), before.end(), temp)]; | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/ios:46, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:25:27: note: '__gnu_cxx::__normal_iterator<char*, std::vector<char> >' is not derived from 'std::istreambuf_iterator<_CharT>' 25 | cout << after[find(before.begin(), before.end(), temp)]; | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s577293028
p00424
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, m; //n??????????????????????´???°???m?????????????±??????° char temp; while(cin >> n, n != 0){ vector<char> before, after; //???????????????????????¨????????????????????? for(int i=0; i<n; ++i){ cin >> temp; before.push_back(temp); cin >> temp; after.push_back(temp); } cin >> m; for(int i=0; i<m; ++i){ cin >> temp; if(find(before.begin(), before.end(), temp) == before.end()){ //??????????????? cout << temp; //???????????? } else{ cout << after[find(before.begin(), before.end(), temp)]; } } cout << "\n"; //?????? } }
a.cc: In function 'int main()': a.cc:26:22: error: no match for 'operator[]' (operand types are 'std::vector<char>' and '__gnu_cxx::__normal_iterator<char*, std::vector<char> >') 26 | cout << after[find(before.begin(), before.end(), temp)]; | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = char; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]' 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1128:28: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::vector<char> >' to 'std::vector<char>::size_type' {aka 'long unsigned int'} 1128 | operator[](size_type __n) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = char; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]' 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1147:28: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::vector<char> >' to 'std::vector<char>::size_type' {aka 'long unsigned int'} 1147 | operator[](size_type __n) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~
s366082658
p00424
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, m; //n??????????????????????´???°???m?????????????±??????° char temp; while(cin >> n, n != 0){ vector<char> before, after; //???????????????????????¨????????????????????? for(int i=0; i<n; ++i){ cin >> temp; before.push_back(temp); cin >> temp; after.push_back(temp); } cin >> m; for(int i=0; i<m; ++i){ cin >> temp; if(find(before.begin(), before.end(), temp) == before.end()){ //??????????????? cout << temp; //???????????? } else{ int outi = find(before.befin(), before.end(), temp); cout << after[outi]; } } cout << "\n"; //?????? } }
a.cc: In function 'int main()': a.cc:26:32: error: 'class std::vector<char>' has no member named 'befin'; did you mean 'begin'? 26 | int outi = find(before.befin(), before.end(), temp); | ^~~~~ | begin
s139678042
p00424
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, m; //n??????????????????????´???°???m?????????????±??????° char temp; while(cin >> n, n != 0){ vector<char> before, after; //???????????????????????¨????????????????????? for(int i=0; i<n; ++i){ cin >> temp; before.push_back(temp); cin >> temp; after.push_back(temp); } cin >> m; for(int i=0; i<m; ++i){ cin >> temp; if(find(before.begin(), before.end(), temp) == before.end()){ //??????????????? cout << temp; //???????????? } else{ int outi = find(before.begin(), before.end(), temp); cout << after[outi]; } } cout << "\n"; //?????? } }
a.cc: In function 'int main()': a.cc:26:24: error: cannot convert '__gnu_cxx::__normal_iterator<char*, std::vector<char> >' to 'int' in initialization 26 | int outi = find(before.begin(), before.end(), temp); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | __gnu_cxx::__normal_iterator<char*, std::vector<char> >
s318103370
p00424
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n, m; //n??????????????????????´???°???m?????????????±??????° char temp; while(cin >> n, n != 0){ vector<char> before, after; //???????????????????????¨????????????????????? for(int i=0; i<n; ++i){ cin >> temp; before.push_back(temp); cin >> temp; after.push_back(temp); } cin >> m; for(int i=0; i<m; ++i){ cin >> temp; if(find(before.begin(), before.end(), temp) == before.end()){ //??????????????? cout << temp; //???????????? } else{ int outi = (int)find(before.begin(), before.end(), temp); cout << after[outi]; } } cout << "\n"; //?????? } }
a.cc: In function 'int main()': a.cc:26:20: error: invalid cast from type '__gnu_cxx::__normal_iterator<char*, std::vector<char> >' to type 'int' 26 | int outi = (int)find(before.begin(), before.end(), temp); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s131987298
p00424
C++
#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; //#define int long long #define DBG 1 #define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;} #define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;} #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define each(it,c) for(auto it=(c).begin();it!=(c).end();it++) #define all(c) c.begin(),c.end() const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9 + 7); int dfs(int n, int max, int s) {
a.cc: In function 'int dfs(int, int, int)': a.cc:15:33: error: expected '}' at end of input 15 | int dfs(int n, int max, int s) { | ~^ a.cc:15:33: warning: no return statement in function returning non-void [-Wreturn-type]