submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s449346962
p00100
C++
//AOJ 0100 #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #include<cctype> using namespace std; #define MAX_N 100 unsigned long long int a[4001] = {0}, b, i, j, k, ans, n; char str[1000]; int sort(const void *a, const void *b){ return *(int*)a - *(int*)b; } int main(){ while(scanf("%lld", &n) != 0){ if(n == 0) return 0; ans = 0; for(i = 0; i < 4001; i++) a[i] = 0; for(i = 0; i < n; i++){ scanf("%lld %lld %lld", &b, &k, &j); if(a[b] >= 1000000) continue; a[b] += k * j; if(a[b] >= 1000000){ printf("%d\n", b); ans++; } } if(ans == 0) printf("NA\n"); return 0; }
a.cc: In function 'int main()': a.cc:34:2: error: expected '}' at end of input 34 | } | ^ a.cc:17:11: note: to match this '{' 17 | int main(){ | ^
s698494865
p00100
C++
#include<iostream> #include<map> using namespace std; int main(){ long long ans[4000]={0}; int n,number,money,many,over_many=0,over[4000]={0}; while(1){ cin >> n; if(n==0)break; over_many=0; memset(over,0,sizeof(over)); memset(ans,0,sizeof(ans)); for(int i=0;i<n;i++){ cin >> number >> money >> many; ans[number]+=money*many; if(ans[number]>=1000000){ if(over[number]==0){ over_many++; over[number]=1; } } } if(over_many==0){ cout << "NA" << endl; } else{ for(int k=0,j=0;j<over_many;k++){ if(over[k]==1){ cout << k << endl; j++; } } } } }
a.cc: In function 'int main()': a.cc:11:5: error: 'memset' was not declared in this scope 11 | memset(over,0,sizeof(over)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<map> +++ |+#include <cstring> 3 | using namespace std;
s687451707
p00100
C++
#include <fstream> using namespace std; main(){ int n,m=0; int id[4000],tanka[4000],suryou[4000]; cin>>n; while(n!=0){ for(int i=0;i<n;i++){ cin>>id[i]>>tanka[i]>>suryou[i]; } for(int i=0;i<n;i++){ if(tanka[i]*suryou[i]>=1000000){ cout<<id[i]<<endl; m++; } } if(m==0) cout<<"NA"<<endl; cin>>n; }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:8:1: error: 'cin' was not declared in this scope 8 | cin>>n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <fstream> +++ |+#include <iostream> 2 | using namespace std; a.cc:16:4: error: 'cout' was not declared in this scope 16 | cout<<id[i]<<endl; | ^~~~ a.cc:16:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:20:11: error: 'cout' was not declared in this scope 20 | if(m==0) cout<<"NA"<<endl; | ^~~~ a.cc:20:11: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:4:7: note: to match this '{' 4 | main(){ | ^
s273647641
p00100
C++
#include <fstream> using namespace std; main(){ int n,m=0; int id[4000],tanka[4000],suryou[4000]; cin>>n; while(n!=0){ for(int i=0;i<n;i++){ cin>>id[i]>>tanka[i]>>suryou[i]; } for(int i=0;i<n;i++){ if(tanka[i]*suryou[i]>=1000000){ cout<<id[i]<<endl; m++; } if(m==0) cout<<"NA"<<endl; cin>>n; } }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:8:1: error: 'cin' was not declared in this scope 8 | cin>>n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <fstream> +++ |+#include <iostream> 2 | using namespace std; a.cc:16:4: error: 'cout' was not declared in this scope 16 | cout<<id[i]<<endl; | ^~~~ a.cc:16:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:19:11: error: 'cout' was not declared in this scope 19 | if(m==0) cout<<"NA"<<endl; | ^~~~ a.cc:19:11: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:4:7: note: to match this '{' 4 | main(){ | ^
s056554393
p00100
C++
while (n = gets().to_i()) != 0 staff = Array.new(4e3, 0); flag = false n.times() do str = gets().split() id = str[0].to_i() price = str[1].to_i() num = str[2].to_i() staff[id - 1] += price * num end staff.each_with_index() do |total, id| if total >= 1e6 puts(id + 1) flag = true end end puts("NA") if !flag end
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while (n = gets().to_i()) != 0 | ^~~~~ a.cc:3:3: error: 'flag' does not name a type 3 | flag = false | ^~~~
s109980207
p00100
C++
#include <bits/stdc++.h> #define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v) using namespace std; typedef long long int lint; static inline int in(){ int x; scanf("%d", &x); return (x); } static inline lint inl(){ lint x; scanf("lld", &x); return (x); } int main() { list<int> staffList; map<int, lint> saleResult; int n; int staffNum; lint unitPrice; lint quantity; while( 1 ) { n = in(); if( n == 0 )break; staffList.clear(); saleResult.clear(); loop(i, 0, n) { staffNum = in(); unitPrice = lin(); quantity = lin(); staffList.push_back(staffNum); saleResult[staffNum] += unitPrice * quantity; } bool flag = false; for(list<int>::iterator it = staffList.begin(); it != staffList.end(); it++) { if( saleResult[*it] >= 1000000 ) { printf("%d\n", *it); saleResult[*it] = 0; flag = true; } } if( !flag ) { cout << "NA" << endl; } } return (0); }
a.cc: In function 'int main()': a.cc:29:37: error: 'lin' was not declared in this scope; did you mean 'sin'? 29 | unitPrice = lin(); | ^~~ | sin
s086965047
p00101
Java
import java.util.Scanner; public class J0101{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int n = Integer.parseInt(s); for(int i=0; i<n; i++){ s = sc.nextLine(); s = s.replaceAll("Hoshino", "Hoshina"); System.out.println(s); } } }
Main.java:3: error: class J0101 is public, should be declared in a file named J0101.java public class J0101{ ^ 1 error
s803003951
p00101
Java
public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String number = br.readLine(); int n = Integer.parseInt(number); for(int i=0; i<n; i++){ String str = br.readLine(); String[] output = str.split(" ", 0); int j=0; for(j=0; j<(output.length)-1 ;j++){ if(output[j].equals("Hoshino")){ System.out.print("Hoshina" + " "); } else{ System.out.print(output[j] + " "); } } if(output[(output.length)-1].equals("Hoshino")){ System.out.println("Hoshina"); } else{ System.out.println(output[(output.length)-1]); } } }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String args[]) throws IOException{ ^ (use --enable-preview to enable unnamed classes) 1 error
s816288374
p00101
Java
import java.io.*; public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String number = br.readLine(); int n = Integer.parseInt(number); for(int i=0; i<n; i++){ String str = br.readLine(); String[] output = str.split(" ", 0); int j=0; for(j=0; j<(output.length)-1 ;j++){ if(output[j].equals("Hoshino")){ System.out.print("Hoshina" + " "); } else{ System.out.print(output[j] + " "); } } if(output[(output.length)-1].equals("Hoshino")){ System.out.println("Hoshina"); } else{ System.out.println(output[(output.length)-1]); } } }
Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String args[]) throws IOException{ ^ (use --enable-preview to enable unnamed classes) 1 error
s419925578
p00101
Java
import java.io.*; public class Main { public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String number = br.readLine(); int n = Integer.parseInt(number); for(int i=0; i<n; i++){ String str = br.readLine(); String[] output = str.split(" ", 0); int j=0; for(j=0; j<(output.length)-1 ;j++){ if(output[j].equals("Hoshino")){ System.out.print("Hoshina" + " "); } else{ System.out.print(output[j] + " "); } } if(output[(output.length)-1].equals("Hoshino")){ System.out.println("Hoshina"); } else{ System.out.println(output[(output.length)-1]); } } } } }
Main.java:30: error: class, interface, enum, or record expected } ^ 1 error
s292698542
p00101
Java
import java.io.*; public class Volume0101 { public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String number = br.readLine(); int n = Integer.parseInt(number); for(int i=0; i<n; i++){ String str = br.readLine(); String[] output = str.split(" ", 0); int j=0; for(j=0; j<(output.length)-1 ;j++){ if(output[j].equals("Hoshino")){ System.out.print("Hoshina" + " "); } else{ System.out.print(output[j] + " "); } } if(output[(output.length)-1].equals("Hoshino")){ System.out.println("Hoshina"); } else{ System.out.println(output[(output.length)-1]); } } } }
Main.java:3: error: class Volume0101 is public, should be declared in a file named Volume0101.java public class Volume0101 { ^ 1 error
s311152584
p00101
Java
public class AOJ0101 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt();sc.nextLine(); while(t--!=0)System.out.println(sc.nextLine().replace("Hoshino", "Hoshina")); } }
Main.java:1: error: class AOJ0101 is public, should be declared in a file named AOJ0101.java public class AOJ0101 { ^ Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0101 Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0101 3 errors
s169667857
p00101
Java
public class AOJ0101 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt();sc.nextLine(); while(t--!=0) System.out.println(sc.nextLine().replace("Hoshino", "Hoshina")); } }
Main.java:1: error: class AOJ0101 is public, should be declared in a file named AOJ0101.java public class AOJ0101 { ^ Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0101 Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0101 3 errors
s187890162
p00101
Java
public class AOJ0101 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); sc.nextLine(); while(t--!=0) System.out.println(sc.nextLine().replace("Hoshino", "Hoshina")); } }
Main.java:1: error: class AOJ0101 is public, should be declared in a file named AOJ0101.java public class AOJ0101 { ^ Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0101 Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class AOJ0101 3 errors
s775995467
p00101
Java
public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); sc.nextLine(); while(t--!=0) System.out.println(sc.nextLine().replace("Hoshino", "Hoshina")); } }
Main.java:1: error: class main is public, should be declared in a file named main.java public class main { ^ Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class main 3 errors
s282190226
p00101
Java
import java.util.Scanner; public class AOJ0101 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt();sc.nextLine(); while(t--!=0)System.out.println(sc.nextLine().replace("Hoshino", "Hoshina")); } }
Main.java:2: error: class AOJ0101 is public, should be declared in a file named AOJ0101.java public class AOJ0101 { ^ 1 error
s801332990
p00101
Java
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt();sc.nextLine(); while(t--!=0)System.out.println(sc.nextLine().replace("Hoshino", "Hoshina")); } }
Main.java:2: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s759100538
p00101
Java
import java.util.*; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt();sc.nextLine(); while(t--!=0) System.out.println(sc.nextLine().replace("Hoshino", "Hoshina")); } }
Main.java:2: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s645913026
p00101
Java
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt();sc.nextLine(); while(t--!=0) System.out.println(sc.nextLine().replaceAll("Hoshino", "Hoshina")); } }
Main.java:2: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s532603906
p00101
Java
mport java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(br.readLine()); for(int i = 0; i < num; i++){ String str = br.readLine(); str = str.replaceAll("Hoshino", "Hoshina"); System.out.println(str); } } }
Main.java:1: error: class, interface, enum, or record expected mport java.io.BufferedReader; ^ Main.java:2: error: class, interface, enum, or record expected import java.io.IOException; ^ Main.java:3: error: class, interface, enum, or record expected import java.io.InputStreamReader; ^ 3 errors
s897316537
p00101
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class p0101 { public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { String strDataNum = br.readLine(); int dataNum = Integer.parseInt(strDataNum); for (int itr = 0; itr < dataNum; itr ++) { String replacedLine = br.readLine().replace("Hoshino", "Hoshina"); System.out.println(replacedLine); } } catch(Exception e) { e.printStackTrace(); } finally { } } }
Main.java:5: error: class p0101 is public, should be declared in a file named p0101.java public class p0101 { ^ 1 error
s054247283
p00101
Java
import java.util.*; public class Hoshina { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; i++) { String s = sc.nextLine(); System.out.println(s.replaceAll("Hoshino", "Hoshina")); } return; } }
Main.java:2: error: class Hoshina is public, should be declared in a file named Hoshina.java public class Hoshina { ^ 1 error
s509922820
p00101
Java
import java.util.*; class Main{ public static void main(String[] args){ ArrayList<String> array = new ArrayList<String>(); Scanner in = new Scanner(System.in); int n = in.nextInt(); for(int i = 0; i <= n; i++){ String str = in.nextLine(); String str2 = str.replaceAll("Hoshino", "Hoshina"); array.add(str2); } for(String s: array){ System.out.println(s); } }
Main.java:16: error: reached end of file while parsing } ^ 1 error
s318582951
p00101
Java
import java.util.*; public class AOJ101 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); sc.nextLine(); for(int j=0;j<i;j++) { String s = sc.nextLine(); System.out.println(s.replaceAll("Hoshino","Hoshina")); } } }
Main.java:2: error: class AOJ101 is public, should be declared in a file named AOJ101.java public class AOJ101 { ^ 1 error
s837016115
p00101
Java
import java.io.*; public class Main { public static void main(String[] args){ try{ BufferedReader b=new BufferedReader(new InputStreamReader(System.in)); int i=Integer.parseInt(b.readLine()); StringBuffer[] str=new StringBuffer[i]; String[] s; for(int j=0;j<i;j++){ str[j]=new StringBuffer(); s=b.readLine().split(" "); for(int k=0;k<s.length;k++){ if(s[k].equals("Hoshino")||s[k].equals("Hoshino.")){ s[k]="Hoshina"; str[j].append(s[k]+" "); } str[j].deleteCharAt(str[j].length()-1); System.out.println(str[j].toString()); } } }catch(IOException e){} return 0; } }
Main.java:22: error: incompatible types: unexpected return value return 0; ^ 1 error
s221287646
p00101
Java
import java.io.*; public class AizuPR { public satic void main(String[] args) throws Exception { Scanner input = new Scanner(System.in); int N = Integer.parseInt(input.nextLine()); for(int i = 0; i < N; i++) { String s = input.nextLine().replaceAll("Hoshino", Hoshina"); System.out.println(s); } } }
Main.java:4: error: <identifier> expected public satic void main(String[] args) throws Exception { ^ Main.java:10: error: unclosed string literal String s = input.nextLine().replaceAll("Hoshino", Hoshina"); ^ 2 errors
s902719223
p00101
Java
import java.util.*; public class AizuPR { public static void main(String[] args) throws Exception { Scanner input = new Scanner(System.in); int N = Integer.parseInt(input.nextLine()); for(int i = 0; i < N; i++) { String s = input.nextLine().replaceAll("Hoshino", "Hoshina"); System.out.println(s); } } }
Main.java:3: error: class AizuPR is public, should be declared in a file named AizuPR.java public class AizuPR { ^ 1 error
s019220404
p00101
Java
public class Main { public static void main(String args[]) throws Exception { BufferedReader bn = new BufferedReader(new InputStreamReader(System.in)); String line; for(int i=0; i<Integer.parseInt(bn.readLine()); i++){ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); line = br.readLine(); String str1 = line.replaceAll("apple", "テンプ"); String str2 = str1.replaceAll("peach", "apple"); String str3 = str2.replaceAll("テンプ", "peach"); System.out.println(str3); } } }
Main.java:3: error: cannot find symbol BufferedReader bn = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader bn = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:3: error: cannot find symbol BufferedReader bn = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main Main.java:8: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:8: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class BufferedReader location: class Main Main.java:8: error: cannot find symbol BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ^ symbol: class InputStreamReader location: class Main 6 errors
s275040550
p00101
Java
import java.util.Scanner; public class AOJMain { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt();sc.nextLine(); while(n--!=0)System.out.println(sc.nextLine()); str = str.replaceAll("Hoshino", "Hoshina"); System.out.println(str); } }
Main.java:3: error: class AOJMain is public, should be declared in a file named AOJMain.java public class AOJMain { ^ Main.java:9: error: cannot find symbol str = str.replaceAll("Hoshino", "Hoshina"); ^ symbol: variable str location: class AOJMain Main.java:9: error: cannot find symbol str = str.replaceAll("Hoshino", "Hoshina"); ^ symbol: variable str location: class AOJMain Main.java:10: error: cannot find symbol System.out.println(str); ^ symbol: variable str location: class AOJMain 4 errors
s936650733
p00101
Java
import java.util.Scanner; public class AOJMain { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt();sc.nextLine(); while(n--!=0)System.out.println(sc.nextLine()); sc = sc.replaceAll("Hoshino", "Hoshina"); System.out.println(sc); } }
Main.java:3: error: class AOJMain is public, should be declared in a file named AOJMain.java public class AOJMain { ^ Main.java:9: error: cannot find symbol sc = sc.replaceAll("Hoshino", "Hoshina"); ^ symbol: method replaceAll(String,String) location: variable sc of type Scanner 2 errors
s407498119
p00101
Java
import java.util.Scanner; //Aizu PR public class AOJ0101 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt();sc.nextLine(); while(t--!=0)System.out.println(sc.nextLine().replaceAll("Hoshino", "Hoshina")); } }
Main.java:4: error: class AOJ0101 is public, should be declared in a file named AOJ0101.java public class AOJ0101 { ^ 1 error
s923861357
p00101
Java
import java.util.Scanner; //Aizu PR public class AOJ0101 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt();sc.nextLine(); while(t--!=0)System.out.println(sc.nextLine().replace("Hoshino", "Hoshina")); } }
Main.java:4: error: class AOJ0101 is public, should be declared in a file named AOJ0101.java public class AOJ0101 { ^ 1 error
s386041662
p00101
C
#include<stdio.h> int main(){ int i,j,n,flag=0; char a[1000]={0}; scanf("%d%*c",&n); for(j=0;j<n;j++){ flag=0; scanf("%c",&a[0]); for(i=1;;i++){ scanf("%c",&a[i]); if(a[i]=='\n'){ a[i]=0; break; } for(i=0;a[i]!=0;i++){ //printf("%d ",flag); if(flag==0){ if(a[i]=='H')flag++; } else if(flag==1){ if(a[i]=='o')flag++; else if(a[i]=='H')flag=1; else flag=0; } else if(flag==2){ if(a[i]=='s')flag++; else if(a[i]=='H')flag=1; else flag=0; } else if(flag==3){ if(a[i]=='h')flag++; else if(a[i]=='H')flag=1; else flag=0; } else if(flag==4){ if(a[i]=='i')flag++; else if(a[i]=='H')flag=1; else flag=0; } else if(flag==5){ if(a[i]=='n')flag++; else if(a[i]=='H')flag=1; else flag=0; } else if(flag==6){ if(a[i]=='o')a[i]='a'; else if(a[i]=='H')flag=1; else flag=0; } } for(i=0;a[i]!=0;i++)printf("%c",a[i]);//puts(""); for(i=0;a[i]!=0;i++)a[i]=0; } return 0; }
main.c: In function 'main': main.c:56:1: error: expected declaration or statement at end of input 56 | } | ^
s243074939
p00101
C
#include<stdio.h> int main(){ int i,j,n,flag=0,d; char a[1000]={0}; scanf("%d%*c",&n); for(j=0;j<n;j++){ flag=0; for(i=0;;i++){ scanf("%c", &a[i]); if(a[i]=='\n'){ a[i]='\0'; d=i; break; } } for(i=0;;i++){ if(d<7) break; if(a[i+6]=='\0') break; if(a[i]=='H'){ if(a[i+1]=='o'){ if(a[i+2]=='s'){ if(a[i+3]=='h'){ if(a[i+4]=='i'){ if(a[i+5]=='n'){ if(a[i+6]=='o'){ a[i+6]='a'; } } } } } } //for(i=0;i<d;i++) printf("%s\n",a);//puts(""); //for(i=0;i<1000;i++)a[i]=0; } return 0; }
main.c: In function 'main': main.c:40:1: error: expected declaration or statement at end of input 40 | } | ^ main.c:40:1: error: expected declaration or statement at end of input
s485153737
p00101
C
#include<stdio.h> int main(void){ char str[3000]: int i,j; int n; scanf("%d",&n); for(i = 0;i < n;i++){ fgets(str.3000,stdin); j = 0; while(str[j] != '\0'){ if(str[j] == 'H'){ if(str[j+1] == 'o'){ if(str[j+2] == 's'){ if(str[j+3] == ' h'){ if(str[j+4] == 'i'){ if(str[j+5] == 'n'){ if(str[j+6] == 'o'){ str[j+6] == 'a'; } } } } } } } j++; } printf("%s",str); } return 0; }
main.c: In function 'main': main.c:3:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token 3 | char str[3000]: | ^ main.c:3:23: error: expected expression before ':' token main.c:7:13: error: 'i' undeclared (first use in this function) 7 | for(i = 0;i < n;i++){ | ^ main.c:7:13: note: each undeclared identifier is reported only once for each function it appears in main.c:8:23: error: 'str' undeclared (first use in this function) 8 | fgets(str.3000,stdin); | ^~~ main.c:8:26: error: expected ')' before numeric constant 8 | fgets(str.3000,stdin); | ~ ^~~~~ | ) main.c:8:17: error: too few arguments to function 'fgets' 8 | fgets(str.3000,stdin); | ^~~~~ In file included from main.c:1: /usr/include/stdio.h:654:14: note: declared here 654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | ^~~~~ main.c:9:17: error: 'j' undeclared (first use in this function) 9 | j = 0; | ^ main.c:14:64: warning: multi-character character constant [-Wmultichar] 14 | if(str[j+3] == ' h'){ | ^~~~
s214681044
p00101
C
#include<stdio.h> int main(void){ char str[3000]: int i,j; int n; scanf("%d",&n); for(i = 0;i < n;i++){ fgets(str.3000,stdin); j = 0; while(str[j] != '\0'){ if(str[j] == 'H'){ if(str[j+1] == 'o'){ if(str[j+2] == 's'){ if(str[j+3] == ' h'){ if(str[j+4] == 'i'){ if(str[j+5] == 'n'){ if(str[j+6] == 'o'){ str[j+6] = 'a'; } } } } } } } j++; } printf("%s",str); } return 0; }
main.c: In function 'main': main.c:3:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token 3 | char str[3000]: | ^ main.c:3:23: error: expected expression before ':' token main.c:7:13: error: 'i' undeclared (first use in this function) 7 | for(i = 0;i < n;i++){ | ^ main.c:7:13: note: each undeclared identifier is reported only once for each function it appears in main.c:8:23: error: 'str' undeclared (first use in this function) 8 | fgets(str.3000,stdin); | ^~~ main.c:8:26: error: expected ')' before numeric constant 8 | fgets(str.3000,stdin); | ~ ^~~~~ | ) main.c:8:17: error: too few arguments to function 'fgets' 8 | fgets(str.3000,stdin); | ^~~~~ In file included from main.c:1: /usr/include/stdio.h:654:14: note: declared here 654 | extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) | ^~~~~ main.c:9:17: error: 'j' undeclared (first use in this function) 9 | j = 0; | ^ main.c:14:64: warning: multi-character character constant [-Wmultichar] 14 | if(str[j+3] == ' h'){ | ^~~~
s062161501
p00101
C
#include<stdio.h> int main(void){ char str[3000]: int i,j; int n; scanf("%d",&n); for(i = 0;i < n;i++){ fgets(str,3000,stdin); j = 0; while(str[j] != '\0'){ if(str[j] == 'H'){ if(str[j+1] == 'o'){ if(str[j+2] == 's'){ if(str[j+3] == 'h'){ if(str[j+4] == 'i'){ if(str[j+5] == 'n'){ if(str[j+6] == 'o'){ str[j+6] = 'a'; } } } } } } } j++; } printf("%s",str); } return 0; }
main.c: In function 'main': main.c:3:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token 3 | char str[3000]: | ^ main.c:3:23: error: expected expression before ':' token main.c:7:13: error: 'i' undeclared (first use in this function) 7 | for(i = 0;i < n;i++){ | ^ main.c:7:13: note: each undeclared identifier is reported only once for each function it appears in main.c:8:23: error: 'str' undeclared (first use in this function) 8 | fgets(str,3000,stdin); | ^~~ main.c:9:17: error: 'j' undeclared (first use in this function) 9 | j = 0; | ^
s590101825
p00101
C
#include <stdio.h> #include <string.h> int main(void){ int n,l,i; char s[1024],*t; scanf("%d",&n); scanf(" "); for(i=0;i<n;j++){ fgets(s,1001,stdin); l=strlen(s); while(t=strstr(s,"Hoshino"),t!=NULL){ t[6]='a'; } printf("%s",s); } return 0; }
main.c: In function 'main': main.c:8:15: error: 'j' undeclared (first use in this function) 8 | for(i=0;i<n;j++){ | ^ main.c:8:15: note: each undeclared identifier is reported only once for each function it appears in
s963991638
p00101
C
#include <stdio.h> #include <string.h> int main(void){ int n,l,i; char s[1024],*t; scanf("%d\n",&n); for(i=0;i<n;i++){ memset(s,0,sizeof(a)); fgets(s,1001,stdin); while(t=strstr(s,"Hoshino"),t!=NULL){ t[6]='a'; } printf("%s",s); } return 0; }
main.c: In function 'main': main.c:8:23: error: 'a' undeclared (first use in this function) 8 | memset(s,0,sizeof(a)); | ^ main.c:8:23: note: each undeclared identifier is reported only once for each function it appears in
s588196873
p00101
C
#include<stdio.h> #include<stdlib.h> #include<string.h> #define text 1002 char *name="Hoshina"; char *wrong_name="Hoshino"; char *delim=" "; char *ctx; int main(void){ int i,j,n,length,count,now; char buf[2]; char istr[text],istr_cpy[text],*next; scanf("%d",&n); fgets(buf,sizeof(buf),stdin); for(i=0;i<n;i++){ fgets(istr,sizeof(istr),stdin); length=strlen(istr); istr[length-1]='\0'; for(j=0;j<length;j++) istr_cpy[j]=istr[j]; istr_cpy[j]='\0'; now=count=0; next = strtok_s(istr, delim, &ctx); while(next){ if(strcmp(wrong_name, next)==0){ for(j=count;j>=0;now++){ if(j==0)break; if(istr_cpy[now]==' '){ j--; } } for(j=0;j<7;j++){ istr_cpy[now+j]=name[j]; } } count++; next = strtok_s(NULL, delim, &ctx); } printf("%s\n",istr_cpy); } return 0; }
main.c: In function 'main': main.c:28:24: error: implicit declaration of function 'strtok_s'; did you mean 'strtok_r'? [-Wimplicit-function-declaration] 28 | next = strtok_s(istr, delim, &ctx); | ^~~~~~~~ | strtok_r main.c:28:22: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 28 | next = strtok_s(istr, delim, &ctx); | ^ main.c:42:30: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 42 | next = strtok_s(NULL, delim, &ctx); | ^
s353727222
p00101
C
#include<stdio.h> #include<string.h> int main(){ char s[2000]; int n, i, j, key = 0; scanf("%d ", &n); while( n-- ) { gets(s); for ( i = 0; i < strlen(s); i++ ) { if ( s[i] == 'H' ) { if ( s[i+1] == 'o' && s[i+2] == 's' && s[i+3] == 'h' && s[i+4] == 'i' && s[i+5] == 'n' && s[i+6] == 'o') { s[i+6] = 'a'; } } } printf("%s\n", s); key++; } return 0; }
main.c: In function 'main': main.c:8:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 8 | gets(s); | ^~~~ | fgets
s558133097
p00101
C
#include<stdio.h> #include<string.h> int main(){ char s[2000]; int n, i, j, key = 0; scanf("%d ", &n); while( n-- ) { gets(s); for ( i = 0; i < strlen(s); i++ ) { if ( s[i] == 'H' ) { if ( s[i+1] == 'o' && s[i+2] == 's' && s[i+3] == 'h' && s[i+4] == 'i' && s[i+5] == 'n' && s[i+6] == 'o') { s[i+6] = 'a'; } } } printf("%s\n", s); key++; } return 0; }
main.c: In function 'main': main.c:8:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 8 | gets(s); | ^~~~ | fgets
s434556485
p00101
C
main(){Congrats_AOJ___Tohoku_Be_Strong();}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){Congrats_AOJ___Tohoku_Be_Strong();} | ^~~~ main.c: In function 'main': main.c:1:8: error: implicit declaration of function 'Congrats_AOJ___Tohoku_Be_Strong' [-Wimplicit-function-declaration] 1 | main(){Congrats_AOJ___Tohoku_Be_Strong();} | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s240675261
p00101
C
#include <stdio.h> #include <string.h> int main(void){ char Hoshina[1001]; char Block[501][501]; int i; int j; int k; int l; int disp; scanf("%d", &i); while (i >= 0){ gets(Hoshina); j = 0; k = 0; l = 0; while(Hoshina[j] != '\0'){ if (Hoshina[j] != ' '){ Block[k][l] = Hoshina[j]; j++; l++; } else{ Block[k][l] = '\0'; l = 0; j++; k++; } } Block[k][l] = '\0'; disp = 0; while(disp != k + 1){ if( strcmp(Block[disp],"Hoshino") == 0){ strcpy(Block[disp],"Hoshina"); } printf("%s", Block[disp]); if(disp != k){ printf(" "); } else{ printf("\n"); } disp++; } i--; } return (0); }
main.c: In function 'main': main.c:17:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 17 | gets(Hoshina); | ^~~~ | fgets
s031319924
p00101
C
char*p,s[1005]; main(i){ for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); exit(0); }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(i){ | ^~~~ main.c: In function 'main': main.c:2:1: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:3:14: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration] 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~ main.c:3:27: error: 'stdin' undeclared (first use in this function) 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~ main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' +++ |+#include <stdio.h> 1 | char*p,s[1005]; main.c:3:27: note: each undeclared identifier is reported only once for each function it appears in 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~ main.c:3:39: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~~ main.c:3:39: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:3:39: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:3:39: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:3:56: error: implicit declaration of function 'strstr' [-Wimplicit-function-declaration] 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'strstr' +++ |+#include <string.h> 1 | char*p,s[1005]; main.c:3:56: warning: incompatible implicit declaration of built-in function 'strstr' [-Wbuiltin-declaration-mismatch] 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~~ main.c:3:56: note: include '<string.h>' or provide a declaration of 'strstr' main.c:4:9: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 4 | exit(0); | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | char*p,s[1005]; main.c:4:9: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 4 | exit(0); | ^~~~ main.c:4:9: note: include '<stdlib.h>' or provide a declaration of 'exit'
s553550920
p00101
C
char*p,s[1005];strstr(); main(i){ for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); exit(0); }
main.c:1:16: warning: data definition has no type or storage class 1 | char*p,s[1005];strstr(); | ^~~~~~ main.c:1:16: error: type defaults to 'int' in declaration of 'strstr' [-Wimplicit-int] main.c:1:16: warning: conflicting types for built-in function 'strstr'; expected 'char *(const char *, const char *)' [-Wbuiltin-declaration-mismatch] main.c:1:1: note: 'strstr' is declared in header '<string.h>' +++ |+#include <string.h> 1 | char*p,s[1005];strstr(); main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(i){ | ^~~~ main.c: In function 'main': main.c:2:1: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:3:14: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration] 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~ main.c:3:27: error: 'stdin' undeclared (first use in this function) 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~ main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' +++ |+#include <stdio.h> 1 | char*p,s[1005];strstr(); main.c:3:27: note: each undeclared identifier is reported only once for each function it appears in 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~ main.c:3:39: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^~~~~~ main.c:3:39: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:3:39: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:3:39: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:3:55: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 3 | for(;fgets(s,1005,stdin);--i&&printf(s))for(;p=strstr(s,"Hoshino");p[6]='a'); | ^ main.c:4:9: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 4 | exit(0); | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | char*p,s[1005];strstr(); main.c:4:9: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 4 | exit(0); | ^~~~ main.c:4:9: note: include '<stdlib.h>' or provide a declaration of 'exit'
s552652275
p00101
C
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { int n; List<String> mesList = new ArrayList<String>(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); n = Integer.parseInt(bufferedReader.readLine()); for(int i = 0; i < n; i++){ mesList.add(bufferedReader.readLine()); } for(String mes : mesList) System.out.println(mes.replaceAll("Hoshino", "Hoshina")); } }
main.c:1:1: error: unknown type name 'import' 1 | import java.io.BufferedReader; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.io.BufferedReader; | ^ main.c:2:1: error: unknown type name 'import' 2 | import java.io.IOException; | ^~~~~~ main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 2 | import java.io.IOException; | ^ main.c:3:1: error: unknown type name 'import' 3 | import java.io.InputStreamReader; | ^~~~~~ main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 3 | import java.io.InputStreamReader; | ^ main.c:4:1: error: unknown type name 'import' 4 | import java.util.ArrayList; | ^~~~~~ main.c:4:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 4 | import java.util.ArrayList; | ^ main.c:5:1: error: unknown type name 'import' 5 | import java.util.List; | ^~~~~~ main.c:5:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 5 | import java.util.List; | ^ main.c:7:1: error: unknown type name 'public' 7 | public class Main { | ^~~~~~ main.c:7:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main' 7 | public class Main { | ^~~~
s765467382
p00101
C
#include<stdio.h> #include<string.h> int main(void){ int i,n; char *p; char a[1002]; char word[]="hoshino" scanf("%d\n",&n); for(i = 0;i < n;i++){ fgets(a,sizeof(a),stdin); while((p = strstr(a,word))!=NULL){ p[6] = 'a'; } printf("%s",a); } return 0; }
main.c: In function 'main': main.c:11:9: error: expected ',' or ';' before 'scanf' 11 | scanf("%d\n",&n); | ^~~~~
s862221783
p00101
C
#include<stdio.h> #include<string.h> int main(void) { int a,n; char english[1000],correct[]="Hoshino",*b; scanf("%d\n",&n); for(a=0;a<n;a++){ fgets(english,1000,stdin); while((b=strstr(english,correct))=NULL) b[6]='a'; printf("%s",english); } return 0; }
main.c: In function 'main': main.c:12:50: error: lvalue required as left operand of assignment 12 | while((b=strstr(english,correct))=NULL) | ^
s253916583
p00101
C
#include<stdio.h> #include<stdlib.h> #include<string.h> #define rep(i,j) for(int i=0;i<(j);i++) int main(){ int n; char s[1001]; char *p; scanf("%d",&n);while(getchar()!='\n'); rep(i,n){ gets(s); p=strstr(s,"Hoshino"); if(p!=NULL)p[6]='a'; puts(s); } return 0; }
main.c: In function 'main': main.c:13:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 13 | gets(s); | ^~~~ | fgets
s548169041
p00101
C
w#include <stdio.h> #include <string.h> #define MAX_LENGTH 1000 int main(void) { int i, n; char sentence[MAX_LENGTH + 1]; char *hoshino = sentence; scanf("%d", &n); for (i = 0; i < n; i++) { scanf("%s", sentence); while ((hoshino = strstr(hoshino, "Hoshino")) != NULL) hoshino[6] = 'a'; printf("%s\n", sentence); } return 0; }
main.c:1:2: error: stray '#' in program 1 | w#include <stdio.h> | ^ main.c:1:1: error: unknown type name 'w' 1 | w#include <stdio.h> | ^ main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | w#include <stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 33 | #include <stddef.h> +++ |+#include <stddef.h> 34 | /usr/include/string.h:47:56: error: unknown type name 'size_t' 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:55:32: error: unknown type name 'size_t' 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:61:42: error: unknown type name 'size_t' 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:64:56: error: unknown type name 'size_t' 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:80:60: error: unknown type name 'size_t' 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:107:48: error: unknown type name 'size_t' 107 | extern void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:145:53: error: unknown type name 'size_t' 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:153:23: error: unknown type name 'size_t' 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:159:57: error: unknown type name 'size_t' 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:166:8: error: unknown type name 'size_t' 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:167:54: error: unknown type name 'size_t' 167 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:8: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:59: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:195:45: error: unknown type name 'size_t' 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:293:8: error: unknown type name 'size_t' 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:297:8: error: unknown type name 'size_t' 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:389:46: error: unknown type name 'size_t' 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:390:44: error: unknown type name 'size_t' 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:398:55: error: unknown type name 'size_t' 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:401:53: error: unknown type name 'size_t' 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:407:8: error: unknown type name 'size_t' 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:8: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:46: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26: /usr/include/string.h:432:12: error: unknown type name 'size_t' 432 | extern int __REDIRECT_NTH (strerror_r, | ^~~~~~~~~~~~~~ /usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: unknown type name 'size_t' 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 23 | #include <stddef.h> +++ |+#include <stddef.h> 24 | /usr/include/strings.h:38:53: error: unknown type name 'size_t' 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:42:31: error: unknown type name 'size_t' 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:120:61: error: unknown type name 'size_t' 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:134:27: error: unknown type name 'size_t' 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/strings.h:134:
s867781402
p00101
C++
n = int(input()) for _ in range(n): s = input() print(s.replace('Hoshino', 'Hoshina'))
a.cc:4:19: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 4 | print(s.replace('Hoshino', 'Hoshina')) | ^~~~~~~~~ a.cc:4:30: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 4 | print(s.replace('Hoshino', 'Hoshina')) | ^~~~~~~~~ a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s499397911
p00101
C++
#include <cstdio> #include <string> #include <iostream> using namespace std; string s; signed main() { int n = 0; scanf( "%d\n", &n ); while( 0 < n ) { getline( cin, s ); s = replace( s, "Hoshino", "Hoshina" ); cout << s << endl; n--; } return 0; }
a.cc: In function 'int main()': a.cc:16:13: error: 'replace' was not declared in this scope 16 | s = replace( s, "Hoshino", "Hoshina" ); | ^~~~~~~
s750066226
p00101
C++
#include<bits/stdc++.h> using namespace std; void strReplace(string& str, const string& from, const string& to){ string::size_type pos = 0; while(pos = str.find(from, pos), pos != string::npos){ str.replace(pos, from.length(), to); pos += to.length(); } } int main(){ cin >> n; cin.clear(); cin.ignore(); for(int i = 0; i < n; i++){ string s; getline(cin, s); strReplace(s, "Hoshino","Hoshina"); cout << s << endl; } }
a.cc: In function 'int main()': a.cc:13:16: error: 'n' was not declared in this scope; did you mean 'yn'? 13 | cin >> n; | ^ | yn
s630479973
p00101
C++
import java.util.*; public class AOJ0101 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); sc.nextLine(); while(t--!=0) System.out.println(sc.nextLine().replace("Hoshino", "Hoshina")); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class AOJ0101 { | ^~~~~~
s080787376
p00101
C++
readline.to_i.times do puts readline.chomp.gsub(/Hoshino/, 'Hoshina') end
a.cc:2:39: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 2 | puts readline.chomp.gsub(/Hoshino/, 'Hoshina') | ^~~~~~~~~ a.cc:1:1: error: 'readline' does not name a type 1 | readline.to_i.times do | ^~~~~~~~
s577017568
p00101
C++
#include<iostream> #include<string> using namespace std; int main (){ int n; int pos; string s; cin >> n; // cin.ignore(); for (int i = 0; i < n ; ++i){ getline(cin, s); while(1){ pos = s.find("Hoshino"); if(pos == -1) break; s[pos+6] = 'a'; } cout << s << '\n'; } return 0;
a.cc: In function 'int main()': a.cc:21:12: error: expected '}' at end of input 21 | return 0; | ^ a.cc:5:12: note: to match this '{' 5 | int main (){ | ^
s677669278
p00101
C++
#include <iostream> #include <string> int main(){ const std::string correct_word = "Hoshina"; const std::string find_word = "Hoshino"; std::string str; while(std::cin >> str){ std::string::size_type pos = str.find("Hoshino") while(pos != std::string::nops){ std::replace(pos, find_word.length(), correct_word); pos = str.find(find_word, pos + find_word.length()); } std::cout << str << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: expected ',' or ';' before 'while' 14 | while(pos != std::string::nops){ | ^~~~~
s218217738
p00101
C++
#include <iostream> #include <string> int main(){ const std::string correct_word = "Hoshina"; const std::string find_word = "Hoshino"; std::string str; while(std::cin >> str){ std::string::size_type pos = str.find("Hoshino"); while(pos != std::string::nops){ std::replace(pos, find_word.length(), correct_word); pos = str.find(find_word, pos + find_word.length()); } std::cout << str << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:43: error: 'nops' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 14 | while(pos != std::string::nops){ | ^~~~ a.cc:15:31: error: 'replace' is not a member of 'std' 15 | std::replace(pos, find_word.length(), correct_word); | ^~~~~~~
s107223828
p00101
C++
#include <iostream> #include <string> int main(){ const std::string correct_word = "Hoshina"; const std::string find_word = "Hoshino"; std::string str; while(std::cin >> str){ std::string::size_type pos = str.find("Hoshino"); while(pos != std::string::nops){ str.replace(pos, find_word.length(), correct_word); pos = str.find(find_word, pos + find_word.length()); } std::cout << str << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:43: error: 'nops' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 14 | while(pos != std::string::nops){ | ^~~~
s197777735
p00101
C++
#include <iostream> #include <string> int main(){ const std::string correct_word = "Hoshina"; const std::string find_word = "Hoshino"; std::string str; int N; std::cin >> N; for(int i = 0; i < N; ++i){ std::cin >> str std::string::size_type pos = str.find("Hoshino"); while(pos != std::string::nops){ str.replace(pos, find_word.length(), correct_word); pos = str.find(find_word, pos + find_word.length()); } std::cout << str << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:32: error: expected ';' before 'std' 16 | std::cin >> str | ^ | ; 17 | std::string::size_type pos = str.find("Hoshino"); | ~~~ a.cc:19:23: error: 'pos' was not declared in this scope 19 | while(pos != std::string::nops){ | ^~~ a.cc:19:43: error: 'nops' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 19 | while(pos != std::string::nops){ | ^~~~
s224626395
p00101
C++
#include <iostream> #include <string> int main(){ const std::string correct_word = "Hoshina"; const std::string find_word = "Hoshino"; std::string str; int N; std::cin >> N; for(int i = 0; i < N; ++i){ std::cin >> str; std::string::size_type pos = str.find("Hoshino"); while(pos != std::string::nops){ str.replace(pos, find_word.length(), correct_word); pos = str.find(find_word, pos + find_word.length()); } std::cout << str << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:43: error: 'nops' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 19 | while(pos != std::string::nops){ | ^~~~
s225106608
p00101
C++
#include <iostream> #include <string> int main(){ const std::string correct_word = "Hoshina"; const std::string find_word = "Hoshino"; int N; std::cin >> N; for(int i = 0; i < N; ++i){ std::string str; std::cin >> str; std::string::size_type pos = str.find("Hoshino"); while(pos != std::string::nops){ str.replace(pos, find_word.length(), correct_word); pos = str.find(find_word, pos + find_word.length()); } std::cout << str << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:43: error: 'nops' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 20 | while(pos != std::string::nops){ | ^~~~
s263483630
p00101
C++
#include <iostream> #include <string> int main(){ int n; // the number of datasets std::cin >> n; std::cin.ignore(); for(int i = 0; i < n; ++i){ std::string text; std::getline(std::cin, text); // input int text_size = text.size(); int moji = text.find("Hoshino"); while(moji != basic_string::npos){ text.replace(moji, 7, "Hoshina"); moji = text.find("Hoshino", moji); } std::cout << text << std::endl; //output } return 0; }
a.cc: In function 'int main()': a.cc:15:31: error: 'basic_string' has not been declared 15 | while(moji != basic_string::npos){ | ^~~~~~~~~~~~
s420129961
p00101
C++
#include <iostream> #include <string> #include <vector> #include <sstream> #include <algorithm> int main(){ int dataSetNum; std::cin >> dataSetNum; std::vector<string> *str = new std::vector<string>[dataSetNum]; //input & sprit for(int i = 0; i < dataSetNum; ++i){ //input std::string tmp; std::string buf; std::cin >> tmp; std::stringstream ss(tmp); //sprit while( getline(ss, buf, ' ') ){ str[i].push_back(buf); } } //replace for(int i = 0; i < dataSetNum; ++i){ std::replace_if(str[i].begin(), str[i].end(), [](string x) { return x == 'Hoshino'; }, 'Hoshina'); } //output for(int i = 0; i < dataSetNum; ++i){ std::for_each(str[i].begin(), str[i].end(), [](string x) { std::cout << x << std::endl; }); } } return 0; }
a.cc:30:32: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 30 | [](string x) { return x == 'Hoshino'; }, 'Hoshina'); | ^~~~~~~~~ a.cc:30:46: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 30 | [](string x) { return x == 'Hoshino'; }, 'Hoshina'); | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:10:21: error: 'string' was not declared in this scope 10 | std::vector<string> *str = new std::vector<string>[dataSetNum]; | ^~~~~~ a.cc:10:21: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:10:27: error: template argument 1 is invalid 10 | std::vector<string> *str = new std::vector<string>[dataSetNum]; | ^ a.cc:10:27: error: template argument 2 is invalid a.cc:10:58: error: template argument 2 is invalid 10 | std::vector<string> *str = new std::vector<string>[dataSetNum]; | ^ a.cc:22:32: error: request for member 'push_back' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 22 | str[i].push_back(buf); | ^~~~~~~~~ a.cc:29:40: error: request for member 'begin' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 29 | std::replace_if(str[i].begin(), str[i].end(), | ^~~~~ a.cc:29:56: error: request for member 'end' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 29 | std::replace_if(str[i].begin(), str[i].end(), | ^~~ a.cc:30:8: error: 'string' is not a type 30 | [](string x) { return x == 'Hoshino'; }, 'Hoshina'); | ^~~~~~ a.cc:35:38: error: request for member 'begin' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 35 | std::for_each(str[i].begin(), str[i].end(), | ^~~~~ a.cc:35:54: error: request for member 'end' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 35 | std::for_each(str[i].begin(), str[i].end(), | ^~~ a.cc:36:8: error: 'string' is not a type 36 | [](string x) { std::cout << x << std::endl; }); | ^~~~~~ a.cc: At global scope: a.cc:39:9: error: expected unqualified-id before 'return' 39 | return 0; | ^~~~~~ a.cc:40:1: error: expected declaration before '}' token 40 | } | ^
s493455105
p00101
C++
#include <iostream> #include <string> #include <vector> #include <sstream> #include <algorithm> int main(){ int dataSetNum; std::cin >> dataSetNum; std::vector<string> *str = new std::vector<string>[dataSetNum]; //input & sprit for(int i = 0; i < dataSetNum; ++i){ //input std::string tmp; std::string buf; std::cin >> tmp; std::stringstream ss(tmp); //sprit while( getline(ss, buf, ' ') ){ str[i].push_back(buf); } } //replace for(int i = 0; i < dataSetNum; ++i){ std::replace_if(str[i].begin(), str[i].end(), [](string x) { return x == 'Hoshino'; }, 'Hoshina'); } //output for(int i = 0; i < dataSetNum; ++i){ std::for_each(str[i].begin(), str[i].end(), [](string x) { std::cout << x << std::endl; }); } } return 0; }
a.cc:30:32: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 30 | [](string x) { return x == 'Hoshino'; }, 'Hoshina'); | ^~~~~~~~~ a.cc:30:46: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 30 | [](string x) { return x == 'Hoshino'; }, 'Hoshina'); | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:10:21: error: 'string' was not declared in this scope 10 | std::vector<string> *str = new std::vector<string>[dataSetNum]; | ^~~~~~ a.cc:10:21: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:10:27: error: template argument 1 is invalid 10 | std::vector<string> *str = new std::vector<string>[dataSetNum]; | ^ a.cc:10:27: error: template argument 2 is invalid a.cc:10:58: error: template argument 2 is invalid 10 | std::vector<string> *str = new std::vector<string>[dataSetNum]; | ^ a.cc:22:32: error: request for member 'push_back' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 22 | str[i].push_back(buf); | ^~~~~~~~~ a.cc:29:40: error: request for member 'begin' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 29 | std::replace_if(str[i].begin(), str[i].end(), | ^~~~~ a.cc:29:56: error: request for member 'end' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 29 | std::replace_if(str[i].begin(), str[i].end(), | ^~~ a.cc:30:8: error: 'string' is not a type 30 | [](string x) { return x == 'Hoshino'; }, 'Hoshina'); | ^~~~~~ a.cc:35:38: error: request for member 'begin' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 35 | std::for_each(str[i].begin(), str[i].end(), | ^~~~~ a.cc:35:54: error: request for member 'end' in '*(str + ((sizetype)(((long unsigned int)i) * 4)))', which is of non-class type 'int' 35 | std::for_each(str[i].begin(), str[i].end(), | ^~~ a.cc:36:8: error: 'string' is not a type 36 | [](string x) { std::cout << x << std::endl; }); | ^~~~~~ a.cc: At global scope: a.cc:39:9: error: expected unqualified-id before 'return' 39 | return 0; | ^~~~~~ a.cc:40:1: error: expected declaration before '}' token 40 | } | ^
s740327823
p00101
C++
#include <iostream> #include <string> #include <vector> #include <sstream> #include <algorithm> int main(){ int dataSetNum; std::cin >> dataSetNum; //std::vector<string> *str = new std::vector<string>[dataSetNum]; std::vector< std::vector<string> > str; str.resize(dataSetNum); //input & sprit for(int i = 0; i < dataSetNum; ++i){ //input std::string tmp; std::string buf; std::cin >> tmp; std::stringstream ss(tmp); //sprit while( getline(ss, buf, ' ') ){ str[i].push_back(buf); } } //replace for(int i = 0; i < dataSetNum; ++i){ std::replace_if(str[i].begin(), str[i].end(), [](string x) { return x == 'Hoshino'; }, 'Hoshina'); } //output for(int i = 0; i < dataSetNum; ++i){ std::for_each(str[i].begin(), str[i].end(), [](string x) { std::cout << x << std::endl; }); } } return 0; }
a.cc:33:32: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 33 | [](string x) { return x == 'Hoshino'; }, 'Hoshina'); | ^~~~~~~~~ a.cc:33:46: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 33 | [](string x) { return x == 'Hoshino'; }, 'Hoshina'); | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:11:34: error: 'string' was not declared in this scope 11 | std::vector< std::vector<string> > str; | ^~~~~~ a.cc:11:34: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:11:40: error: template argument 1 is invalid 11 | std::vector< std::vector<string> > str; | ^ a.cc:11:40: error: template argument 2 is invalid a.cc:11:42: error: template argument 1 is invalid 11 | std::vector< std::vector<string> > str; | ^ a.cc:11:42: error: template argument 2 is invalid a.cc:12:13: error: request for member 'resize' in 'str', which is of non-class type 'int' 12 | str.resize(dataSetNum); | ^~~~~~ a.cc:25:28: error: invalid types 'int[int]' for array subscript 25 | str[i].push_back(buf); | ^ a.cc:32:36: error: invalid types 'int[int]' for array subscript 32 | std::replace_if(str[i].begin(), str[i].end(), | ^ a.cc:32:52: error: invalid types 'int[int]' for array subscript 32 | std::replace_if(str[i].begin(), str[i].end(), | ^ a.cc:33:8: error: 'string' is not a type 33 | [](string x) { return x == 'Hoshino'; }, 'Hoshina'); | ^~~~~~ a.cc:38:34: error: invalid types 'int[int]' for array subscript 38 | std::for_each(str[i].begin(), str[i].end(), | ^ a.cc:38:50: error: invalid types 'int[int]' for array subscript 38 | std::for_each(str[i].begin(), str[i].end(), | ^ a.cc:39:8: error: 'string' is not a type 39 | [](string x) { std::cout << x << std::endl; }); | ^~~~~~ a.cc: At global scope: a.cc:43:9: error: expected unqualified-id before 'return' 43 | return 0; | ^~~~~~ a.cc:44:1: error: expected declaration before '}' token 44 | } | ^
s413371369
p00101
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> int main(){ std::string correctword = "Hoshina"; int dataSetNum; std::cin >> dataSetNum; std::vector< std::string > str; str.resize(dataSetNum); std::cin.ignore(); //input for(int i = 0; i < dataSetNum; ++i){ //input std::string tmp; getline(std::cin, tmp); str[i] = tmp; } //replace for(int i = 0; i < dataSetNum; ++i){ std::string tmp = "Hoshino"; //std::string::size_type pos = str[i].find(tmp); auto pos = str[i].find(tmp); while(pos != std::string::npos){ str[i].replace(str[i].begin() + pos, str[i].begin() + pos + 7, correctword.begin(), correctword.end() ); pos = str[i].find(tmp, pos + 7); } } //output for(int i = 0; i < dataSetNum; ++i){ std::for_each(str[i].begin() , str[i].end(), [](std::string x) { std::cout << x << std::endl; } ); } return 0; }
In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h: In instantiation of '_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Funct = main()::<lambda(string)>]': a.cc:38:19: required from here 38 | std::for_each(str[i].begin() , str[i].end(), | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | [](std::string x) { std::cout << x << std::endl; } ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:3786:12: error: no match for call to '(main()::<lambda(std::string)>) (char&)' 3786 | __f(*__first); | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:3786:12: note: candidate: 'void (*)(std::string)' {aka 'void (*)(std::__cxx11::basic_string<char>)'} (conversion) /usr/include/c++/14/bits/stl_algo.h:3786:12: note: candidate expects 2 arguments, 2 provided a.cc:39:5: note: candidate: 'main()::<lambda(std::string)>' 39 | [](std::string x) { std::cout << x << std::endl; } ); | ^ a.cc:39:5: note: no known conversion for argument 1 from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
s787008476
p00101
C++
n = gets puts $_.gsub("Hoshiro", "Hoshina") while gets
a.cc:1:1: error: 'n' does not name a type 1 | n = gets | ^
s873733391
p00101
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; char str[1001]; char hoshino[] = "Hoshino"; int hlen = strlen(hoshino); void changeHoshino(int len) { for (int i = 0; i <= len - hlen; i++) { int j = 0; while ((j < hlen) && (str[i+j] == hoshino[j])) j++; if (j == hlen) str[i+j-1] = 'a'; } } int main() { int n; cin >> n; fgets(str, 1001, stdin); for (int i = 0; i < n; i++) { fgets(str, 1001, stdin); changeHoshino(strlen(str)); cout << str; } return 0; }
a.cc:9:12: error: 'strlen' was not declared in this scope 9 | int hlen = strlen(hoshino); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | #include <string> a.cc: In function 'int main()': a.cc:30:31: error: 'strlen' was not declared in this scope 30 | changeHoshino(strlen(str)); | ^~~~~~ a.cc:30:31: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s209046058
p00101
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; char str[1001]; char hoshino[] = "Hoshino"; int hlen = strlen(hoshino); void changeHoshino(int len) { for (int i = 0; i <= len - hlen; i++) { int j = 0; while ((j < hlen) && (str[i+j] == hoshino[j])) j++; if (j == hlen) str[i+j-1] = 'a'; } } int main() { int n; cin >> n; fgets(str, 1001, stdin); for (int i = 0; i < n; i++) { fgets(str, 1001, stdin); changeHoshino(strlen(str)); cout << str; } return 0; }
a.cc:9:12: error: 'strlen' was not declared in this scope 9 | int hlen = strlen(hoshino); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | #include <string> a.cc: In function 'int main()': a.cc:30:31: error: 'strlen' was not declared in this scope 30 | changeHoshino(strlen(str)); | ^~~~~~ a.cc:30:31: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s144640552
p00101
C++
#include <iostream> #include <cstdio> #include <string> #include <cstring> using namespace std; string str; string hoshino = "Hoshino"; int hlen = hoshino.length(); void changeHoshino(int len) { for (int i = 0; i <= len - hlen; i++) { int j = 0; while ((j < hlen) && (str[i+j] == hoshino[j])) j++; if (j == hlen) str[i+j-1] = 'a'; } } int main() { int n; scanf_s("%d\n", &n); for (int i = 0; i < n; i++) { getline(cin, str); changeHoshino(str.length()); cout << str << endl; } return 0; }
a.cc: In function 'int main()': a.cc:25:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 25 | scanf_s("%d\n", &n); | ^~~~~~~ | scanf
s268243672
p00101
C++
#include<iostream> using namespace std; int main(){ int dataN,i,j,tmp; string str; cin>>dataN; for(j=0;j<dataN;j++){ cin>>str; for(i=0;i<str.length;i++){ if(str[i]+str[i+1]+str[i+2]+str[i+3]+str[i+4]+str[i+5]+str[i+6]=="Hoshino"){ str[i+6]='a'; i+=6; } } cout<<str; } return 0; }
a.cc: In function 'int main()': a.cc:11:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 11 | for(i=0;i<str.length;i++){ | ~~~~^~~~~~ | () a.cc:12:74: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if(str[i]+str[i+1]+str[i+2]+str[i+3]+str[i+4]+str[i+5]+str[i+6]=="Hoshino"){
s392322821
p00101
C++
#include<iostream> #include<string> using namespace std; #define BAD "hoshino" int main(){ int n,i; cin>>n; for(i=0;i<n;i++){ hoge(); } return 0; } int hoge(){ string text; int i; cin>>text; for(i=0;i<text.length();i++){ if(text.substr(i,BAD.length())==BAD){ text[i+BAD.length()-1]='a'; } } cout<<text<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:10: error: 'hoge' was not declared in this scope 12 | hoge(); | ^~~~ a.cc: In function 'int hoge()': a.cc:24:31: error: request for member 'length' in '"hoshino"', which is of non-class type 'const char [8]' 24 | if(text.substr(i,BAD.length())==BAD){ | ^~~~~~ a.cc:25:22: error: request for member 'length' in '"hoshino"', which is of non-class type 'const char [8]' 25 | text[i+BAD.length()-1]='a'; | ^~~~~~
s963326745
p00101
C++
#include<iostream> #include<string> using namespace std; #define BAD "hoshino" int hoge(void); int main(){ int n,i; cin>>n; for(i=0;i<n;i++){ hoge(); } return 0; } int hoge(){ string text; int i; cin>>text; for(i=0;i<text.length();i++){ if(text.substr(i,BAD.length())==BAD){ text[i+BAD.length()-1]='a'; } } cout<<text<<endl; return 0; }
a.cc: In function 'int hoge()': a.cc:26:31: error: request for member 'length' in '"hoshino"', which is of non-class type 'const char [8]' 26 | if(text.substr(i,BAD.length())==BAD){ | ^~~~~~ a.cc:27:22: error: request for member 'length' in '"hoshino"', which is of non-class type 'const char [8]' 27 | text[i+BAD.length()-1]='a'; | ^~~~~~
s285079088
p00101
C++
#include <iostream> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <string> #include <cmath> #include <cfloat> #include <map> using namespace std; int main(){ int n; string s; string d="Hoshina"; cin>>n; while(n--){ while(getline(cin,s)!="\n"); while(1){ unsigned int loc = s.find("Hoshino"); if(loc!=string::npos) s.replace(loc,d.size(),d); else break; } cout<<s<<endl; } }
a.cc: In function 'int main()': a.cc:18:37: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'const char [2]') 18 | while(getline(cin,s)!="\n"); | ~~~~~~~~~~~~~~^~~~~~ | | | | | const char [2] | std::basic_istream<char> In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::fpos<_StateT>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::allocator<_CharT>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::pair<_T1, _T2>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::tuple<_UTypes ...>' 18 | while(getline(cin,s)!="\n"); | ^~~~ 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: /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: n
s778893652
p00101
C++
#include <iostream> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <string> #include <cmath> #include <cfloat> #include <map> using namespace std; int main(){ int n; string s; string d="Hoshina"; cin>>n; while(n--){ while(getline(cin,s)!="\n"); while(1){ unsigned int loc = s.find("Hoshino"); if(loc!=string::npos) s.replace(loc,d.size(),d); else break; } cout<<s<<endl; } }
a.cc: In function 'int main()': a.cc:18:37: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'const char [2]') 18 | while(getline(cin,s)!="\n"); | ~~~~~~~~~~~~~~^~~~~~ | | | | | const char [2] | std::basic_istream<char> In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::fpos<_StateT>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::allocator<_CharT>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::pair<_T1, _T2>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::tuple<_UTypes ...>' 18 | while(getline(cin,s)!="\n"); | ^~~~ 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: /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: n
s975382913
p00101
C++
#include <iostream> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <string> #include <cmath> #include <cfloat> #include <map> using namespace std; int main(){ int n; string s; string d="Hoshina"; cin>>n; while(n--){ while(getline(cin,s)!="\n"); while(1){ unsigned int loc = s.find("Hoshino"); if(loc!=string::npos) s.replace(loc,d.size(),d); else break; } cout<<s<<endl; } }
a.cc: In function 'int main()': a.cc:18:37: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'const char [2]') 18 | while(getline(cin,s)!="\n"); | ~~~~~~~~~~~~~~^~~~~~ | | | | | const char [2] | std::basic_istream<char> In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::fpos<_StateT>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::allocator<_CharT>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::pair<_T1, _T2>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::tuple<_UTypes ...>' 18 | while(getline(cin,s)!="\n"); | ^~~~ 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: /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: n
s552218916
p00101
C++
#include <iostream> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <string> #include <cmath> #include <cfloat> #include <map> using namespace std; int main(){ int n; string s; string d="Hoshina"; cin>>n; while(n--){ while(getline(cin,s)!="\n"); while(1){ unsigned int loc = s.find("Hoshino"); if(loc!=string::npos) s.replace(loc,d.size(),d); else break; } cout<<s<<endl; } }
a.cc: In function 'int main()': a.cc:18:37: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'const char [2]') 18 | while(getline(cin,s)!="\n"); | ~~~~~~~~~~~~~~^~~~~~ | | | | | const char [2] | std::basic_istream<char> In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::fpos<_StateT>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::allocator<_CharT>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::pair<_T1, _T2>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 18 | while(getline(cin,s)!="\n"); | ^~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n"); | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::tuple<_UTypes ...>' 18 | while(getline(cin,s)!="\n"); | ^~~~ 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: /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: n
s453692149
p00101
C++
#include <iostream> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <string> #include <cmath> #include <cfloat> #include <map> using namespace std; int main(){ int n; string s; string d="Hoshina"; cin>>n; while(n--){ while(getline(cin,s)!="\n") while(1){ unsigned int loc = s.find("Hoshino"); if(loc!=string::npos) s.replace(loc,d.size(),d); else break; } cout<<s<<endl; } }
a.cc: In function 'int main()': a.cc:18:37: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'const char [2]') 18 | while(getline(cin,s)!="\n") | ~~~~~~~~~~~~~~^~~~~~ | | | | | const char [2] | std::basic_istream<char> In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::fpos<_StateT>' 18 | while(getline(cin,s)!="\n") | ^~~~ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::allocator<_CharT>' 18 | while(getline(cin,s)!="\n") | ^~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n") | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 18 | while(getline(cin,s)!="\n") | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n") | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 18 | while(getline(cin,s)!="\n") | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::pair<_T1, _T2>' 18 | while(getline(cin,s)!="\n") | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n") | ^~~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | while(getline(cin,s)!="\n") | ^~~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 18 | while(getline(cin,s)!="\n") | ^~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n") | ^~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:18:39: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 18 | while(getline(cin,s)!="\n") | ^~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | while(getline(cin,s)!="\n") | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:18:39: note: 'std::basic_istream<char>' is not derived from 'const std::tuple<_UTypes ...>' 18 | while(getline(cin,s)!="\n") | ^~~~ 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: /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: template
s132961986
p00101
C++
#include<iostream> #include<string> using namespace std; int main(){ string text; int n,j; int i; cin>>n; for(j=0;j<n;j++){ cin>>text; while(1){ i=text.find("Hoshino"); if(i!=string::not_found){ text[i+6]='a'; }else{ break; } } cout<<text<<endl; } }
a.cc: In function 'int main()': a.cc:16:25: error: 'not_found' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 16 | if(i!=string::not_found){ | ^~~~~~~~~
s473056620
p00101
C++
#include<iostream> using namespace std; int main(){ int n,j; int flg; char c; cin>>n; for(j=0;j<n;j++){ flg=0; while(1){ c=getchar(); if(c==endl){ break; }else{ switch(flg){ case 0: if(c=='H'){flg++;} break; case 1: if(c=='o'){flg++;}else{flg=0;} break; case 2: if(c=='s'){flg++;}else{flg=0;} break; case 3: if(c=='h'){flg++;}else{flg=0;} break; case 4: if(c=='i'){flg++;}else{flg=0;} break; case 5: if(c=='n'){flg++;}else{flg=0;} break; case 6: if(c=='o'){c='a';} flg=0; break; } cout<<c; } } cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:15: error: invalid operands of types 'char' and '<unresolved overloaded function type>' to binary 'operator==' 14 | if(c==endl){ | ~^~~~~~
s819985662
p00101
C++
#include<iostream> #include<stdio.h> using namespace std; int main(){ int n,j; int flg; char c; cin>>n; for(j=0;j<n;j++){ //??\???????????? flg=0; while(1){ c=getchar(); if(c==endl){ break; }else{ switch(flg){ case 0: if(c=='H'){flg++;} break; case 1: if(c=='o'){flg++;}else{flg=0;} break; case 2: if(c=='s'){flg++;}else{flg=0;} break; case 3: if(c=='h'){flg++;}else{flg=0;} break; case 4: if(c=='i'){flg++;}else{flg=0;} break; case 5: if(c=='n'){flg++;}else{flg=0;} break; case 6: if(c=='o'){c='a';} flg=0; break; } cout<<c; } } cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:15: error: invalid operands of types 'char' and '<unresolved overloaded function type>' to binary 'operator==' 16 | if(c==endl){ | ~^~~~~~
s285723253
p00101
C++
n = int(input()) for i in range(n): l = [s for s in input().split()] for s in l: if 'Hoshino' in s: l[l.index(s)] = s.replace('Hoshino','Hoshina') a = '' for s in l: a += s a += ' ' a = a.rstrip() print(a)
a.cc:5:8: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 5 | if 'Hoshino' in s: | ^~~~~~~~~ a.cc:6:33: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 6 | l[l.index(s)] = s.replace('Hoshino','Hoshina') | ^~~~~~~~~ a.cc:6:43: warning: multi-character literal with 7 characters exceeds 'int' size of 4 bytes 6 | l[l.index(s)] = s.replace('Hoshino','Hoshina') | ^~~~~~~~~ a.cc:7:7: error: empty character constant 7 | a = '' | ^~ a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s018020629
p00101
C++
using System; class Example { static void Main() { int n = int.Parse(Console.ReadLine()); for (int a = 0; a < n; a++) { string[] input = Console.ReadLine().Split(' '); if (string.IsNullOrEmpty(input[0])) break; for (int i = 0; i < input.Length - 1; i++) { if (input[i] == "Hoshino") input[i] = "Hoshina"; Console.Write(input[i] + " "); } Console.WriteLine(input[input.Length - 1]); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:22:2: error: expected ';' after class definition 22 | } | ^ | ; a.cc: In static member function 'static void Example::Main()': a.cc:6:17: error: expected primary-expression before 'int' 6 | int n = int.Parse(Console.ReadLine()); | ^~~ a.cc:9:13: error: 'string' was not declared in this scope 9 | string[] input = Console.ReadLine().Split(' '); | ^~~~~~ a.cc:9:20: error: expected primary-expression before ']' token 9 | string[] input = Console.ReadLine().Split(' '); | ^ a.cc:10:38: error: 'input' was not declared in this scope; did you mean 'int'? 10 | if (string.IsNullOrEmpty(input[0])) | ^~~~~ | int a.cc:12:33: error: 'input' was not declared in this scope; did you mean 'int'? 12 | for (int i = 0; i < input.Length - 1; i++) | ^~~~~ | int a.cc:16:17: error: 'Console' was not declared in this scope 16 | Console.Write(input[i] + " "); | ^~~~~~~ a.cc:18:13: error: 'Console' was not declared in this scope 18 | Console.WriteLine(input[input.Length - 1]); | ^~~~~~~ a.cc:18:31: error: 'input' was not declared in this scope; did you mean 'int'? 18 | Console.WriteLine(input[input.Length - 1]); | ^~~~~ | int
s107737776
p00101
C++
#include<iostream> #include<string> using namespace std; int main(void) { int n; string a; cin >> n; cin.ignore(); for (int i = 0; i < n; ++i){ int x = 0; getline(cin, a); if ((x = a.find("Hoshino")) >= 0) a.replace(x, strlen("Hoshino"), "Hoshina"); cout << a << endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:38: error: 'strlen' was not declared in this scope 18 | a.replace(x, strlen("Hoshino"), "Hoshina"); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | #include<string>
s094017074
p00101
C++
#include<iostream> #include<string> using namespace std; int main(void) { int n; string a; cin >> n; cin.ignore(); for (int i = 0; i < n; ++i){ int x = 0; getline(cin, a); if ((x = a.find("Hoshino")) >= 0) a.replace(x, strlen("Hoshino"), "Hoshina"); cout << a << endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:38: error: 'strlen' was not declared in this scope 18 | a.replace(x, strlen("Hoshino"), "Hoshina"); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | #include<string>
s073985540
p00101
C++
#include<iostream> #include<string> using namespace std; int main(void) { int n; string a; cin >> n; cin.ignore(); for (int i = 0; i < n; ++i){ int x = 0; getline(cin, a); if ((x = a.find("Hoshino")) >= 0) a.replace(x, strlen("Hoshino"), "Hoshina"); cout << a << endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:38: error: 'strlen' was not declared in this scope 18 | a.replace(x, strlen("Hoshino"), "Hoshina"); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | #include<string>
s692450638
p00101
C++
#include<iostream> #include<string> using namespace std; int main(void) { int n; string a; cin >> n; cin.ignore(); for (int i = 0; i < n; ++i){ int x = 0; getline(cin, a); if ((x = a.find("Hoshino")) >= 0) a.replace(x, strlen("Hoshino"), "Hoshina"); cout << a << endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:38: error: 'strlen' was not declared in this scope 18 | a.replace(x, strlen("Hoshino"), "Hoshina"); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | #include<string>
s979053478
p00101
C++
#include<iostream> #include<string> #include<cstdio> using namespace std; int main(void) { int n; string a; cin >> n; cin.ignore(); for (int i = 0; i < n; ++i){ int x = 0; getline(cin, a); if ((x = a.find("Hoshino")) >= 0) a.replace(x, strlen("Hoshino"), "Hoshina"); cout << a << endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:38: error: 'strlen' was not declared in this scope 19 | a.replace(x, strlen("Hoshino"), "Hoshina"); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<cstdio> +++ |+#include <cstring> 4 |
s387434090
p00101
C++
##include <iostream> #include <string> int main(){ std::string sent; int gyou,num=0; std::cin >> gyou; getline(std::cin, sent); for(int i=0;i<gyou;++i){ num=0; getline(std::cin, sent); std::string bef="Hoshino",aft="Hoshina"; while(num!=-1){ num=(int)(sent.find(bef)); if(num!=-1){ sent.replace(num,bef.size(),aft); } } std::cout << sent; if(i<gyou-1) std::cout << std::endl; } return 0; }
a.cc:1:1: error: stray '##' in program 1 | ##include <iostream> | ^~ a.cc:1:3: error: 'include' does not name a type 1 | ##include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~ | __n /usr/include/c++/14/bits/char_traits.h: At global scope: /usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std'
s646504893
p00101
C++
#include <iostream> #include <string> int main(){ const std::string wrong_word("Hoshino"); const std::string right_word("Hoshina"); int num; std::cin >> num; std::cin.ignore(); // ignore next newline character for(int i = 0; i < num; ++i){ std::string str; std::getline(std::cin, str); std::size_t pos = str.find(wrong_word); while(pos != std::string::npos){ str.replace(pos, wrong_word.length(), right_word); pos = str.find(wrong_word); } std::cout << str << std::endl; } return 0;
a.cc: In function 'int main()': a.cc:24:14: error: expected '}' at end of input 24 | return 0; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s832916644
p00101
C++
#include <iostream> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <vector> #include <algorithm> #include <utility> #include <queue> int n; using namespace std; bool is_change(string& str,int pos, int len){ const char A[] = {'H','o','s','h','i','n','a'}; if(str.substr(pos,len) == "Hoshino"){ for(int i=pos,j=0;i<pos+len,j<7;i++,j++){ str[i] = A[j]; } return true; } return false; } int main(){ std::ios::sync_with_stdio(false); cin>>n; for(int i=0;i<n;i++){ string str; for(int i=0;i+6<str.size();i++){ if(change(str,i,7)){ i+=6; } } cout<<str<<"\n"; } return 0; }
a.cc: In function 'int main()': a.cc:28:28: error: 'change' was not declared in this scope; did you mean 'is_change'? 28 | if(change(str,i,7)){ | ^~~~~~ | is_change
s990437302
p00101
C++
//#include <bits/c++.h> #include <iostream> #include <cstdio> #define rep(i,n) for(int i = 0; i< n; i++) #define MAX_SIZE 1010 using namespace std; int main(){ int n; cin >> n; // cout << n << endl; for(int j = 0; j<= n; j++) { char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'a') { cout << "Hoshino"; i+=7; check = false; } if(*(s+i) != 'H' || check == true) printf("%c",*(s+i)); i++; } } if(j != 0) cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 18 | gets(s); | ^~~~ | getw a.cc:43:20: error: 'j' was not declared in this scope 43 | if(j != 0) cout << endl; | ^ a.cc: At global scope: a.cc:45:9: error: expected unqualified-id before 'return' 45 | return 0; | ^~~~~~ a.cc:47:1: error: expected declaration before '}' token 47 | } | ^
s651138578
p00101
C++
//#include <bits/c++.h> #include <iostream> #include <cstdio> #define rep(i,n) for(int i = 0; i< n; i++) #define MAX_SIZE 1010 using namespace std; int main(){ int n; cin >> n; // cout << n << endl; for(int j = 0; j<= n; j++) { char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'a') { cout << "Hoshino"; i+=7; check = false; } if(*(s+i) != 'H' || check == true) printf("%c",*(s+i)); i++; } } if(j != 0) cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 18 | gets(s); | ^~~~ | getw a.cc:43:20: error: 'j' was not declared in this scope 43 | if(j != 0) cout << endl; | ^ a.cc: At global scope: a.cc:45:9: error: expected unqualified-id before 'return' 45 | return 0; | ^~~~~~ a.cc:47:1: error: expected declaration before '}' token 47 | } | ^
s387904516
p00101
C++
//#include <bits/c++.h> #include <iostream> #include <cstdio> #define rep(i,n) for(int i = 0; i< n; i++) #define MAX_SIZE 1010 using namespace std; int main(){ int n; cin >> n; // cout << n << endl; for(int j = 0; j<=n; j++) { char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'o') { cout << "Hoshina"; i+=7; check = false; } if(*(s+i) != 'H' || check == true) { printf("%c",*(s+i)); i++; } } if(j)cout << endl; } if(j == false) cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 18 | gets(s); | ^~~~ | getw a.cc:45:12: error: 'j' was not declared in this scope 45 | if(j == false) | ^
s512205621
p00101
C++
//#include <bits/c++.h> #include <iostream> #include <cstdio> #define rep(i,n) for(int i = 0; i< n; i++) #define MAX_SIZE 1010 using namespace std; int main(){ int n; cin >> n; // cout << n << endl; for(int j = 0; j<=n; j++) { char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'o') { cout << "Hoshina"; i+=7; check = false; } if(*(s+i) != 'H' || check == true) { printf("%c",*(s+i)); i++; } } if(j)cout << endl; } if(j == false) cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 18 | gets(s); | ^~~~ | getw a.cc:45:12: error: 'j' was not declared in this scope 45 | if(j == false) | ^
s104600718
p00101
C++
//#include <bits/c++.h> #include <iostream> #include <cstdio> #define rep(i,n) for(int i = 0; i< n; i++) #define MAX_SIZE 1010 using namespace std; int main(){ int n; cin >> n; // cout << n << endl; for(int j = 0; j<=n; j++) { char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'o') { cout << "Hoshina"; i+=7; check = false; } if(*(s+i) != 'H' || check == true) { printf("%c",*(s+i)); i++; } } if(j)cout << endl; } if(j == false) cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 18 | gets(s); | ^~~~ | getw a.cc:45:12: error: 'j' was not declared in this scope 45 | if(j == false) | ^
s741050480
p00101
C++
//#include <bits/c++.h> #include <iostream> #include <cstdio> #define rep(i,n) for(int i = 0; i< n; i++) #define MAX_SIZE 1010 using namespace std; int main(){ int n; cin >> n; // cout << n << endl; int j; bool checking = true; for( j = 0; j<=n; j++) { checking = true; char s[MAX_SIZE] = {}; gets(s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'o') { cout << "Hoshina"; i+=7; check = false; checking = check; } if(*(s+i) != 'H' || check == true) { printf("%c",*(s+i)); i++; } checking = true; } if(j)cout << endl; if(checking == false) { cout << endl; checking = true; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 20 | gets(s); | ^~~~ | getw
s506934523
p00101
C++
//#include <bits/c++.h> #include <iostream> #include <cstdio> #define rep(i,n) for(int i = 0; i< n; i++) #define MAX_SIZE 1010 using namespace std; int main(){ int n; cin >> n; // cout << n << endl; int j; bool checking = true; for( j = 0; j<=n; j++) { checking = true; char s[MAX_SIZE] = {}; getline(cin,s); int i = 0; while(*(s+i) != '\0') { //printf("%c",*(s+i)); bool check = true; if(*(s+i) == 'H') if(*(s+i+1) == 'o') if(*(s+i+2) =='s' ) if(*(s+i+3) =='h' ) if(*(s+i+4) == 'i') if(*(s+i+5) == 'n' ) if(*(s+i+6) == 'o') { cout << "Hoshina"; i+=7; check = false; checking = check; } if(*(s+i) != 'H' || check == true) { printf("%c",*(s+i)); i++; } checking = true; } if(j)cout << endl; if(checking == false) { cout << endl; checking = true; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:24: error: no matching function for call to 'getline(std::istream&, char [1010])' 20 | getline(cin,s); | ~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/string:55, 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:2: /usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 907 | getline(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4117 | getline(basic_istream<_CharT, _Traits>& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4117:5: note: template argument deduction/substitution failed: a.cc:20:24: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char [1010]' 20 | getline(cin,s); | ~~~~~~~^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 4125 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4132 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4132:5: note: template argument deduction/substitution failed: a.cc:20:24: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char [1010]' 20 | getline(cin,s); | ~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154: /usr/include/stdio.h:697:18: note: candidate: '__ssize_t getline(char**, size_t*, FILE*)' 697 | extern __ssize_t getline (char **__restrict __lineptr, | ^~~~~~~ /usr/include/stdio.h:697:18: note: candidate expects 3 arguments, 2 provided