submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s448913190
p00060
C++
int main(){ for(int a,b,c;std::cin>>a>>b>>c;){ int x=20-a-b,f=3; if(x<a)f--; if(x<b)f--; if(x<c)f--; std::cout<<((x-f>4)?"YES\n":"NO\n"); } }
a.cc: In function 'int main()': a.cc:2:28: error: 'cin' is not a member of 'std' 2 | for(int a,b,c;std::cin>>a>>b>>c;){ | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | int main(){ a.cc:7:22: error: 'cout' is not a member of 'std' 7 | std::cout<<((x-f>4)?"YES\n":"NO\n"); | ^~~~ a.cc:7:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s203663872
p00061
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; class Main{ static class DataOfPCK{ int num; int answer; DataOfPCK(int num,int answer){ this.num=num; this.answer=answer; } static final Comparator<DataOfPCK> ANSWER_ORDER=new AnswerOrderComprator(); private static class AnswerOrderComparator implements Comparator<DataOfPCK>{ public int compare(DataOfPCK d1,DataOfPCK d2){ return (d1.answer>d2.answer)?1:(d1.answer<d2.answer)?-1:0; } } } public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; ArrayList<DataOfPCK> array=new ArrayList<DataOfPCK>(); HashMap<Integer,Integer> dic=new HashMap<Integer,Integer>(); DataOfPCK d; int p,rank; while(!(line=br.readLine()).equals("0,0")){ String[] values=line.split(","); int num=Integer.parseInt(values[0]); int answer=Integer.parseInt(values[1]); array.add(new DataOfPCK(num,answer)); } Collections.sort(array,DataOfPCK.ANSWER_ORDER); p=-1; rank=1; for(int i=array.size()-1;i>=0;i--){ d=array.get(i); if(d.answer==p){ dic.put(d.num,rank); } else{ dic.put(d.num,rank); p=d.answer; rank++; } } while((line=br.readLine())!=null){ System.out.println(dic.get(Integer.parseInt(line))); } } }
Main.java:20: error: cannot find symbol static final Comparator<DataOfPCK> ANSWER_ORDER=new AnswerOrderComprator(); ^ symbol: class AnswerOrderComprator location: class DataOfPCK 1 error
s082938765
p00061
Java
import java.util.*; public class aoj0061 { static final Scanner stdin = new Scanner(System.in); public static void main(String[] args){ HashMap<String, Integer> map = new HashMap<String, Integer>(); TreeMap<Integer, Integer>rmap = new TreeMap<Integer, Integer>(Collections.reverseOrder()); while(true){ String[] record = stdin.nextLine().split(","); if(record[0].equals("0") && record[1].equals("0")) break; int num = Integer.parseInt(record[1]); map.put(record[0], num); rmap.put(num, 1); } Iterator<Integer> itr = rmap.keySet().iterator(); int rank = 1; while(itr.hasNext()) rmap.put(itr.next(), rank++); while(stdin.hasNext()) System.out.println( rmap.get( map.get(stdin.nextLine()) ) ); } }
Main.java:2: error: class aoj0061 is public, should be declared in a file named aoj0061.java public class aoj0061 { ^ 1 error
s356624324
p00061
Java
import java.util.*; class main{ public static void Main(String args[]){ Scanner sc = new Scanner(System.in); ArrayList <Integer>array = new ArrayList(); while(true){ String input = sc.next(); String[] ranks = input.split(","); if(ranks[0] == ranks[1] && ranks[0] == 0){ break; }else{ array.add(Integer.praseInt(ranks[1])); } } while(sc.hasNext()){ int address = sc.nextInt(); int requestedScore = array.get(address); int count = 0; for(int i = 0; i < array.size(); i++){ if(requestedScore < array.get(i)){ count++; } } println(array.size() - count); } } }
Main.java:9: error: bad operand types for binary operator '==' if(ranks[0] == ranks[1] && ranks[0] == 0){ ^ first type: String second type: int Main.java:12: error: cannot find symbol array.add(Integer.praseInt(ranks[1])); ^ symbol: method praseInt(String) location: class Integer Main.java:24: error: cannot find symbol println(array.size() - count); ^ symbol: method println(int) location: class main Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 errors
s023769028
p00061
Java
import java.util.*; class main{ public static void Main(String args[]){ Scanner sc = new Scanner(System.in); ArrayList <Integer>array = new ArrayList(); while(true){ String input = sc.next(); String[] ranks = input.split(","); if(ranks[0] == ranks[1] && ranks[0] == "0"){ break; }else{ array.add(Integer.praseInt(ranks[1])); } } while(sc.hasNext()){ int address = sc.nextInt(); int requestedScore = array.get(address); int count = 0; for(int i = 0; i < array.size(); i++){ if(requestedScore < array.get(i)){ count++; } } println(array.size() - count); } } }
Main.java:12: error: cannot find symbol array.add(Integer.praseInt(ranks[1])); ^ symbol: method praseInt(String) location: class Integer Main.java:24: error: cannot find symbol println(array.size() - count); ^ symbol: method println(int) location: class main Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors
s129329360
p00061
Java
import java.util.*; class main{ public static void Main(String args[]){ Scanner sc = new Scanner(System.in); ArrayList <Integer>array = new ArrayList(); while(true){ String input = sc.next(); String[] ranks = input.split(","); if(ranks[0] == ranks[1] && ranks[0] == "0"){ break; }else{ array.add(Integer.parseInt(ranks[1])); } } while(sc.hasNext()){ int address = sc.nextInt(); int requestedScore = array.get(address); int count = 0; for(int i = 0; i < array.size(); i++){ if(requestedScore < array.get(i)){ count++; } } println(array.size() - count); } } }
Main.java:24: error: cannot find symbol println(array.size() - count); ^ symbol: method println(int) location: class main Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
s629846884
p00061
Java
import java.util.*; class main{ public static void Main(String args[]){ Scanner sc = new Scanner(System.in); ArrayList <Integer>array = new ArrayList(); while(true){ String input = sc.next(); String[] ranks = input.split(","); if(ranks[0] == ranks[1] && ranks[0] == "0"){ break; }else{ array.add(Integer.parseInt(ranks[1])); } } while(sc.hasNext()){ int address = sc.nextInt(); int requestedScore = array.get(address); int count = 0; for(int i = 0; i < array.size(); i++){ if(requestedScore < array.get(i)){ count++; } } System.out.println(array.size() - count); } } }
Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
s055148426
p00061
Java
import java.util.*; class main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); ArrayList <Integer>array = new ArrayList(); while(true){ String input = sc.next(); String[] ranks = input.split(","); if(ranks[0] == ranks[1] && ranks[0] == "0"){ break; }else{ array.add(Integer.parseInt(ranks[1])); } } while(sc.hasNext()){ int address = sc.nextInt(); int requestedScore = array.get(address); int count = 0; for(int i = 0; i < array.size(); i++){ if(requestedScore < array.get(i)){ count++; } } System.out.println(array.size() - count); } } }
Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
s362502990
p00061
C
#include <cstdio> #include <algorithm> using namespace std; int main(){ int x[10000],y[10000],a,s,i=0,j,sum=0,z[10000]={}; while(1){ scanf("%d,%d",&s,&a); if(s==0) break; x[s-1]=a; y[s-1]=x[s-1]; sum++; } sort(x,x+sum); int r=100; for(i=0;i<sum;i++){ for(j=0;j<sum;j++){ if(x[i]<x[j]){ if(r!=x[j]){ z[i]++; r=x[j]; } }} r=100;} int d; while(scanf("%d",&d)!=EOF){ for(i=0;i<sum;i++){ if(x[i]==y[d-1]){ printf("%d\n",z[i]+1); goto yu; }}yu:; } return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s190616375
p00061
C++
#include<iostream> #include<utility> #include<vector> #include<cmath> #include<cstdio> using namespace std; int main(){ pair<int,int> fun[100]; int num,acc,tel,i=0,tmp; int j,z; while(1){ scanf("%d,%d",&num,&acc); if(num == 0 && acc == 0) break; fun[i] = make_pair(acc,num); i++; } sort(fun,fun+i); tmp = fun[i-1].first; j = 1; fun[i-1].first = j; for(z=i-2;z>=0;z--){ if(tmp == fun[z].first){ fun[z].first = j; } else{ j++; tmp = fun[z].first; fun[z].first = j; } } while(cin >> tel){ for(j=0;j<i;j++){ if(fun[j].second == tel){ cout << fun[j].first << endl; } } } }
a.cc: In function 'int main()': a.cc:18:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 18 | sort(fun,fun+i); | ^~~~ | sqrt
s311493552
p00061
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <utility> #include <stack> #include <queue> #include <cstdlib> #include <cstdio> #include <cstring> #include <cmath> #define rep(n) for(int i=0; i<(n); i++) #define pb(n) push_back((n)) //typedef long long ll; using namespace std; int main(){ vector<pair<int,int> > v(101,pair<int,int>(0,1000)); int i=0; while(1){ int a,b; scanf("%d,%d",&a,&b); if(a==0&&b==0)break; v[i].first=b; v[i].second=a; i++; } sort(v,v.end()); reverse(v,v.end()); vector<int> r(101,0); int p=v[0].first; int rank=1; for(i=0; i<101; i++){ if(p==v[i].first)r[i]=v[i].second; else{ rank++; p=v[i].first; r[i]=v[i].second; } } while(cin>>i){ cout<<r[i-1]<<endl; } }
a.cc: In function 'int main()': a.cc:31:13: error: no matching function for call to 'sort(std::vector<std::pair<int, int> >&, std::vector<std::pair<int, int> >::iterator)' 31 | sort(v,v.end()); | ~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed: a.cc:31:13: note: deduced conflicting types for parameter '_RAIter' ('std::vector<std::pair<int, int> >' and '__gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >') 31 | sort(v,v.end()); | ~~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided a.cc:32:16: error: no matching function for call to 'reverse(std::vector<std::pair<int, int> >&, std::vector<std::pair<int, int> >::iterator)' 32 | reverse(v,v.end()); | ~~~~~~~^~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: candidate: 'template<class _BIter> void std::reverse(_BIter, _BIter)' 1083 | reverse(_BidirectionalIterator __first, _BidirectionalIterator __last) | ^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:1083:5: note: template argument deduction/substitution failed: a.cc:32:16: note: deduced conflicting types for parameter '_BIter' ('std::vector<std::pair<int, int> >' and '__gnu_cxx::__normal_iterator<std::pair<int, int>*, std::vector<std::pair<int, int> > >') 32 | reverse(v,v.end()); | ~~~~~~~^~~~~~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate: 'template<class _ExecutionPolicy, class _BidirectionalIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::reverse(_ExecutionPolicy&&, _BidirectionalIterator, _BidirectionalIterator)' 249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last); | ^~~~~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:249:1: note: candidate expects 3 arguments, 2 provided
s773064666
p00061
C++
#include<bits/stdc++.h> using namespace std; int main() { ???int team[101],num=0,point,lank[101],co=0,flag=0; ???queue<int> que; ???string str; ???for(int i=1;i<101;i++)team[i]=-1; ???while(cin>>str){ ??????if(str[0]=='0'&&str[2]=='0')break; ??????for(int i=0;;i++){ ?????????if(str[i]==','){ ????????????for(int j=0;j<i;j++)num+=(str[j]-'0')*(int)pow(10,i-j-1); ????????????team[num]=0; ????????????point=i; ?????????} ?????????else if(str[i]=='\0'){ ????????????for(int j=point+1;j<i;j++)team[num]+=(str[j]-'0')*pow(10,i-j-1); ???????????????break; ?????????} ??????} ??????num=0; ???} ???point=0; ???for(int i=1;flag!=1;i++){ ??????flag=1; ??????for(int j=1;j<101;j++){ ?????????if(point<team[j]){ ????????????flag=0; ????????????point=team[j]; ????????????if(co!=0){ ???????????????for(int k=0;k<co;k++)que.pop(); ????????????} ????????????co=1; ????????????que.push(j); ?????????} ?????????else if(point==team[j]){ ????????????flag=0; ????????????que.push(j); ????????????co++; ?????????} ??????} ??????for(int j=0;j<co;j++){ ?????????lank[que.front()]=i; ?????????team[que.front()]=-1; ?????????que.pop(); ??????} ??????point=0;co=0; ???} ???while(cin>>num)cout<<lank[num]<<endl; }
a.cc: In function 'int main()': a.cc:5:1: error: expected primary-expression before '?' token 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^ a.cc:5:2: error: expected primary-expression before '?' token 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^ a.cc:5:3: error: expected primary-expression before '?' token 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^ a.cc:5:4: error: expected primary-expression before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ a.cc:5:4: error: expected ':' before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ | : a.cc:5:4: error: expected primary-expression before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ a.cc:5:4: error: expected ':' before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ | : a.cc:5:4: error: expected primary-expression before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ a.cc:5:4: error: expected ':' before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ | : a.cc:5:4: error: expected primary-expression before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ a.cc:6:1: error: expected primary-expression before '?' token 6 | ???queue<int> que; | ^ a.cc:6:2: error: expected primary-expression before '?' token 6 | ???queue<int> que; | ^ a.cc:6:3: error: expected primary-expression before '?' token 6 | ???queue<int> que; | ^ a.cc:6:15: error: expected primary-expression before 'que' 6 | ???queue<int> que; | ^~~ a.cc:6:14: error: expected ':' before 'que' 6 | ???queue<int> que; | ^~~~ | : a.cc:6:15: error: 'que' was not declared in this scope 6 | ???queue<int> que; | ^~~ a.cc:6:18: error: expected ':' before ';' token 6 | ???queue<int> que; | ^ | : a.cc:6:18: error: expected primary-expression before ';' token a.cc:6:18: error: expected ':' before ';' token 6 | ???queue<int> que; | ^ | : a.cc:6:18: error: expected primary-expression before ';' token a.cc:7:1: error: expected primary-expression before '?' token 7 | ???string str; | ^ a.cc:7:2: error: expected primary-expression before '?' token 7 | ???string str; | ^ a.cc:7:3: error: expected primary-expression before '?' token 7 | ???string str; | ^ a.cc:7:11: error: expected primary-expression before 'str' 7 | ???string str; | ^~~ a.cc:7:10: error: expected ':' before 'str' 7 | ???string str; | ^~~~ | : a.cc:7:11: error: 'str' was not declared in this scope; did you mean 'std'? 7 | ???string str; | ^~~ | std a.cc:7:14: error: expected ':' before ';' token 7 | ???string str; | ^ | : a.cc:7:14: error: expected primary-expression before ';' token a.cc:7:14: error: expected ':' before ';' token 7 | ???string str; | ^ | : a.cc:7:14: error: expected primary-expression before ';' token a.cc:8:1: error: expected primary-expression before '?' token 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^ a.cc:8:2: error: expected primary-expression before '?' token 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^ a.cc:8:3: error: expected primary-expression before '?' token 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^ a.cc:8:4: error: expected primary-expression before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ a.cc:8:4: error: expected ':' before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ | : a.cc:8:4: error: expected primary-expression before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ a.cc:8:4: error: expected ':' before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ | : a.cc:8:4: error: expected primary-expression before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ a.cc:8:4: error: expected ':' before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ | : a.cc:8:4: error: expected primary-expression before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ a.cc:8:16: error: 'i' was not declared in this scope 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^ a.cc:9:1: error: expected primary-expression before '?' token 9 | ???while(cin>>str){ | ^ a.cc:9:2: error: expected primary-expression before '?' token 9 | ???while(cin>>str){ | ^ a.cc:9:3: error: expected primary-expression before '?' token 9 | ???while(cin>>str){ | ^ a.cc:9:4: error: expected primary-expression before 'while' 9 | ???while(cin>>str){ | ^~~~~ a.cc:9:4: error: expected ':' before 'while' 9 | ???while(cin>>str){ | ^~~~~ | : a.cc:9:4: error: expected primary-expression before 'while' 9 | ???while(cin>>str){ | ^~~~~ a.cc:9:4: error: expected ':' before 'while' 9 | ???while(cin>>str){ | ^~~~~ | : a.cc:9:4: error: expected primary-expression before 'while' 9 | ???while(cin>>str){ | ^~~~~ a.cc:9:4: error: expected ':' before 'while' 9 | ???while(cin>>str){ | ^~~~~ | : a.cc:9:4: error: expected primary-expression before 'while' 9 | ???while(cin>>str){ | ^~~~~ a.cc:24:1: error: expected primary-expression before '?' token 24 | ???point=0; | ^ a.cc:24:2: error: expected primary-expression before '?' token 24 | ???point=0; | ^ a.cc:24:3: error: expected primary-expression before '?' token 24 | ???point=0; | ^ a.cc:24:4: error: 'point' was not declared in this scope 24 | ???point=0; | ^~~~~ a.cc:24:11: error: expected ':' before ';' token 24 | ???point=0; | ^ | : a.cc:24:11: error: expected primary-expression before ';' token a.cc:24:11: error: expected ':' before ';' token 24 | ???point=0; | ^ | : a.cc:24:11: error: expected primary-expression before ';' token a.cc:24:11: error: expected ':' before ';' token 24 | ???point=0; | ^ | : a.cc:24:11: error: expected primary-expression before ';' token a.cc:25:1: error: expected primary-expression before '?' token 25 | ???for(int i=1;flag!=1;i++){ | ^ a.cc:25:2: error: expected primary-expression before '?' token 25 | ???for(int i=1;flag!=1;i++){ | ^ a.cc:25:3: error: expected primary-expression before '?' token 25 | ???for(int i=1;flag!=1;i++){ | ^ a.cc:25:4: error: expected primary-expression before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ a.cc:25:4: error: expected ':' before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ | : a.cc:25:4: error: expected primary-expression before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ a.cc:25:4: error: expected ':' before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ | : a.cc:25:4: error: expected primary-expression before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ a.cc:25:4: error: expected ':' before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ | : a.cc:25:4: error: expected primary-expression before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ a.cc:25:16: error: 'flag' was not declared in this scope 25 | ???for(int i=1;flag!=1;i++){ | ^~~~ a.cc:51:1: error: expected primary-expression before '?' token 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^ a.cc:51:2: error: expected primary-expression before '?' token 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^ a.cc:51:3: error: expected primary-expression before '?' token 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^ a.cc:51:4: error: expected primary-expression before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ a.cc:51:4: error: expected ':' before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ | : a.cc:51:4: error: expected primary-expression before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ a.cc:51:4: error: expected ':' before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ | : a.cc:51:4: error: expected primary-expression before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ a.cc:51:4: error: expected ':' before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ | : a.cc:51:4: error: expected primary-expression before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~
s098162648
p00061
C++
#include<bits/stdc++.h> using namespace std; int main() { ???int team[101],num=0,point,lank[101],co=0,flag=0; ???queue<int> que; ???string str; ???for(int i=1;i<101;i++)team[i]=-1; ???while(cin>>str){ ??????if(str[0]=='0'&&str[2]=='0')break; ??????for(int i=0;;i++){ ?????????if(str[i]==','){ ????????????for(int j=0;j<i;j++)num+=(str[j]-'0')*(int)pow(10,i-j-1); ????????????team[num]=0; ????????????point=i; ?????????} ?????????else if(str[i]=='\0'){ ????????????for(int j=point+1;j<i;j++)team[num]+=(str[j]-'0')*pow(10,i-j-1); ???????????????break; ?????????} ??????} ??????num=0; ???} ???point=0; ???for(int i=1;flag!=1;i++){ ??????flag=1; ??????for(int j=1;j<101;j++){ ?????????if(point<team[j]){ ????????????flag=0; ????????????point=team[j]; ????????????if(co!=0){ ???????????????for(int k=0;k<co;k++)que.pop(); ????????????} ????????????co=1; ????????????que.push(j); ?????????} ?????????else if(point==team[j]){ ????????????flag=0; ????????????que.push(j); ????????????co++; ?????????} ??????} ??????for(int j=0;j<co;j++){ ?????????lank[que.front()]=i; ?????????team[que.front()]=-1; ?????????que.pop(); ??????} ??????point=0;co=0; ???} ???while(cin>>num)cout<<lank[num]<<endl; }
a.cc: In function 'int main()': a.cc:5:1: error: expected primary-expression before '?' token 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^ a.cc:5:2: error: expected primary-expression before '?' token 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^ a.cc:5:3: error: expected primary-expression before '?' token 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^ a.cc:5:4: error: expected primary-expression before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ a.cc:5:4: error: expected ':' before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ | : a.cc:5:4: error: expected primary-expression before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ a.cc:5:4: error: expected ':' before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ | : a.cc:5:4: error: expected primary-expression before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ a.cc:5:4: error: expected ':' before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ | : a.cc:5:4: error: expected primary-expression before 'int' 5 | ???int team[101],num=0,point,lank[101],co=0,flag=0; | ^~~ a.cc:6:1: error: expected primary-expression before '?' token 6 | ???queue<int> que; | ^ a.cc:6:2: error: expected primary-expression before '?' token 6 | ???queue<int> que; | ^ a.cc:6:3: error: expected primary-expression before '?' token 6 | ???queue<int> que; | ^ a.cc:6:15: error: expected primary-expression before 'que' 6 | ???queue<int> que; | ^~~ a.cc:6:14: error: expected ':' before 'que' 6 | ???queue<int> que; | ^~~~ | : a.cc:6:15: error: 'que' was not declared in this scope 6 | ???queue<int> que; | ^~~ a.cc:6:18: error: expected ':' before ';' token 6 | ???queue<int> que; | ^ | : a.cc:6:18: error: expected primary-expression before ';' token a.cc:6:18: error: expected ':' before ';' token 6 | ???queue<int> que; | ^ | : a.cc:6:18: error: expected primary-expression before ';' token a.cc:7:1: error: expected primary-expression before '?' token 7 | ???string str; | ^ a.cc:7:2: error: expected primary-expression before '?' token 7 | ???string str; | ^ a.cc:7:3: error: expected primary-expression before '?' token 7 | ???string str; | ^ a.cc:7:11: error: expected primary-expression before 'str' 7 | ???string str; | ^~~ a.cc:7:10: error: expected ':' before 'str' 7 | ???string str; | ^~~~ | : a.cc:7:11: error: 'str' was not declared in this scope; did you mean 'std'? 7 | ???string str; | ^~~ | std a.cc:7:14: error: expected ':' before ';' token 7 | ???string str; | ^ | : a.cc:7:14: error: expected primary-expression before ';' token a.cc:7:14: error: expected ':' before ';' token 7 | ???string str; | ^ | : a.cc:7:14: error: expected primary-expression before ';' token a.cc:8:1: error: expected primary-expression before '?' token 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^ a.cc:8:2: error: expected primary-expression before '?' token 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^ a.cc:8:3: error: expected primary-expression before '?' token 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^ a.cc:8:4: error: expected primary-expression before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ a.cc:8:4: error: expected ':' before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ | : a.cc:8:4: error: expected primary-expression before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ a.cc:8:4: error: expected ':' before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ | : a.cc:8:4: error: expected primary-expression before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ a.cc:8:4: error: expected ':' before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ | : a.cc:8:4: error: expected primary-expression before 'for' 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^~~ a.cc:8:16: error: 'i' was not declared in this scope 8 | ???for(int i=1;i<101;i++)team[i]=-1; | ^ a.cc:9:1: error: expected primary-expression before '?' token 9 | ???while(cin>>str){ | ^ a.cc:9:2: error: expected primary-expression before '?' token 9 | ???while(cin>>str){ | ^ a.cc:9:3: error: expected primary-expression before '?' token 9 | ???while(cin>>str){ | ^ a.cc:9:4: error: expected primary-expression before 'while' 9 | ???while(cin>>str){ | ^~~~~ a.cc:9:4: error: expected ':' before 'while' 9 | ???while(cin>>str){ | ^~~~~ | : a.cc:9:4: error: expected primary-expression before 'while' 9 | ???while(cin>>str){ | ^~~~~ a.cc:9:4: error: expected ':' before 'while' 9 | ???while(cin>>str){ | ^~~~~ | : a.cc:9:4: error: expected primary-expression before 'while' 9 | ???while(cin>>str){ | ^~~~~ a.cc:9:4: error: expected ':' before 'while' 9 | ???while(cin>>str){ | ^~~~~ | : a.cc:9:4: error: expected primary-expression before 'while' 9 | ???while(cin>>str){ | ^~~~~ a.cc:24:1: error: expected primary-expression before '?' token 24 | ???point=0; | ^ a.cc:24:2: error: expected primary-expression before '?' token 24 | ???point=0; | ^ a.cc:24:3: error: expected primary-expression before '?' token 24 | ???point=0; | ^ a.cc:24:4: error: 'point' was not declared in this scope 24 | ???point=0; | ^~~~~ a.cc:24:11: error: expected ':' before ';' token 24 | ???point=0; | ^ | : a.cc:24:11: error: expected primary-expression before ';' token a.cc:24:11: error: expected ':' before ';' token 24 | ???point=0; | ^ | : a.cc:24:11: error: expected primary-expression before ';' token a.cc:24:11: error: expected ':' before ';' token 24 | ???point=0; | ^ | : a.cc:24:11: error: expected primary-expression before ';' token a.cc:25:1: error: expected primary-expression before '?' token 25 | ???for(int i=1;flag!=1;i++){ | ^ a.cc:25:2: error: expected primary-expression before '?' token 25 | ???for(int i=1;flag!=1;i++){ | ^ a.cc:25:3: error: expected primary-expression before '?' token 25 | ???for(int i=1;flag!=1;i++){ | ^ a.cc:25:4: error: expected primary-expression before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ a.cc:25:4: error: expected ':' before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ | : a.cc:25:4: error: expected primary-expression before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ a.cc:25:4: error: expected ':' before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ | : a.cc:25:4: error: expected primary-expression before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ a.cc:25:4: error: expected ':' before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ | : a.cc:25:4: error: expected primary-expression before 'for' 25 | ???for(int i=1;flag!=1;i++){ | ^~~ a.cc:25:16: error: 'flag' was not declared in this scope 25 | ???for(int i=1;flag!=1;i++){ | ^~~~ a.cc:51:1: error: expected primary-expression before '?' token 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^ a.cc:51:2: error: expected primary-expression before '?' token 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^ a.cc:51:3: error: expected primary-expression before '?' token 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^ a.cc:51:4: error: expected primary-expression before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ a.cc:51:4: error: expected ':' before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ | : a.cc:51:4: error: expected primary-expression before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ a.cc:51:4: error: expected ':' before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ | : a.cc:51:4: error: expected primary-expression before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ a.cc:51:4: error: expected ':' before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~ | : a.cc:51:4: error: expected primary-expression before 'while' 51 | ???while(cin>>num)cout<<lank[num]<<endl; | ^~~~~
s514683031
p00061
C++
#include<iostream> #include<set> #include<cstdio> using namespace std; int main() { int a, b; set<int> c; int d[101]; while (scanf_s("%d,%d", &a, &b) && a != 0 && b != 0) { c.insert(b); d[a] = b; } int i = c.size(); while (cin >> a){ b = d[a]; set<int>::iterator it = c.end(); it--; int sum = 0; for (int j = 0; j < i; j++) { sum++; if ((*it) == b) { cout << sum << endl; break; } it--; } } }
a.cc: In function 'int main()': a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | while (scanf_s("%d,%d", &a, &b) && a != 0 && b != 0) { | ^~~~~~~ | scanf
s056263300
p00061
C++
#include <iostream> #include <cstdio> #include <vector> #include <set> using namespace std; typedef pair<int,int> pp; bool cmp( pp a , pp b){ return a.second < b.second; } int main(){ int a,b,n; vector<pp> hello; while(scanf("%d,%d",&a,&b) && a){ hello.push_back(make_pair(a,b)); } vector<int> rank(hello.size()); sort(hello.begin(),hello.end(),cmp); int r = 1; int mi = 0; for(int i=0;i<hello.size();i++){ if(mi < hello[i].second){ r++; mi = hello[i].second; } rank[i] = r ; } while(cin >> n){ cout << rank[n-1] << endl; } }
a.cc: In function 'int main()': a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(hello.begin(),hello.end(),cmp); | ^~~~ | short
s198409699
p00061
C++
#include <iostream> #include <cstdio> #include <vector> #include <set> #include <algorithm> using namespace std; typedef pair<int,int> pp; bool cmp( pp a , pp b){ return a.second > b.second; } int main(){ int a,b,n; vector<pp> hello; while(scanf("%d,%d",&a,&b) && a){ hello.push_back(make_pair(a,b)); } vector<int> rank(hello.size()); sort(hello.begin(),hello.end(),cmp); int r = 0; int mi = INT_MAX; for(int i=0;i<hello.size();i++){ if(mi > hello[i].second){ r++; mi = hello[i].second; } rank[hello[i].first-1] = r ; } while(cin >> n){ cout << rank[n-1] << endl; } }
a.cc: In function 'int main()': a.cc:22:18: error: 'INT_MAX' was not declared in this scope 22 | int mi = INT_MAX; | ^~~~~~~ a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 5 | #include <algorithm> +++ |+#include <climits> 6 | using namespace std;
s138313288
p00061
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <cassert> #include <iostream> #include <cctype> #include <sstream> #include <string> #include <list> #include <vector> #include <queue> #include <set> #include <stack> #include <map> #include <utility> #include <numeric> #include <algorithm> #include <iterator> #include <bitset> #include <complex> #include <fstream> using namespace std; typedef long long ll; const double EPS = 1e-9; typedef vector<int> vint; typedef pair<int, int> pint; #define rep(i, n) REP(i, 0, n) #define ALL(v) v.begin(), v.end() #define MSG(a) cout << #a << " " << a << endl; #define REP(i, x, n) for(int i = x; i < n; i++) template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); } template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; } template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; } template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); } struct J { int p; J(int p) : p(p){} bool operator () (int x) { return p < x; } }; int main() { map<int, int> team; vint points; int n, p; char k; while(cin >> n >> k >> p && (n || p)) { points.push_back(p); team.insert(pair<int, int>(n, p)); } sort(ALL(points)); points.erase(unique(ALL(points)), points.end()); while(cin >> n) { J j(team[n]); cout << count_if(ALL(points), j) + 1 << endl; } } #endif
a.cc:69:2: error: #endif without #if 69 | #endif | ^~~~~
s788302355
p00061
C++
#include<cstdio> #include<algorithm> using namespace std; int date[100000]; bool bit[31]; int did[31]; int main() { memset(bit,false,sizeof(bit)); while(true) { int a,b; scanf("%d,%d",&a,&b); if(a==0&&b==0)break; bit[b]=true; date[a]=b; } int k=1; for(int i=30;i>-1;i--) { if(bit[i]==true) { did[i]=k; k++; } } int j; while(scanf("%d",&j)!=EOF) { printf("%d",did[date[j]]); } return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'memset' was not declared in this scope 12 | memset(bit,false,sizeof(bit)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> +++ |+#include <cstring> 3 |
s784023469
p00061
C++
#include <iostream> #include <stdio.h> #include <vector> using namespace std; vector<int> da[31]; int main() { int id,sc,n,i,j; while (scanf("%d,%d",&id,&sc)) { if (id==0 && sc==0) break; da[sc].push_back(id); } while (cin >> id) { n=0; for (i=30;i>=0;i--) { if (da[i].size()>0) { n++; for (j=0; j<da[i].size(); j++) if (da[i][j]==id) cout << n << endl; } } } return 0;
a.cc: In function 'int main()': a.cc:22:18: error: expected '}' at end of input 22 | return 0; | ^ a.cc:7:12: note: to match this '{' 7 | int main() { | ^
s037576523
p00061
C++
#include <iostream> #include <string> #include <cstdio> #include <vector> using namespace std; struct P{ int num; int point; int rank; static bool more (const P& left,const P& right){ return left.point > right.point; } }; int main(){ int n,cnt=0; vector <P> data; P tmp; while(1){ scanf("%d,%d",&tmp.num,&tmp.point); if(tmp.num == 0 && tmp.point == 0) break; data.push_back(tmp); cnt++; } sort(data.begin(),data.end(),P::more); for(int i=0,rank=1;i<cnt;i++){ if(i == 0) data[i].rank = rank; else if(data[i].point == data[i-1].point) data[i].rank = rank; else if(data[i].point < data[i-1].point){ rank++; data[i].rank= rank; } } while(scanf("%d",&n) != EOF){ for(int i=0;i<cnt;i++){ if(data[i].num == n){ cout << data[i].rank << endl; break; } } } }
a.cc: In function 'int main()': a.cc:26:5: error: 'sort' was not declared in this scope; did you mean 'short'? 26 | sort(data.begin(),data.end(),P::more); | ^~~~ | short
s713921858
p00061
C++
team = [0 for i in range(101)] point= [[0 for i in range(2)] for i in range(31)] while 1: temp= map(int, raw_input().split(',')) if temp[0] ==0==temp[1]: break team[temp[0]]=temp[1] if point[temp[1]][1]==0: point[temp[1]][1]=1 for i in range(temp[1]+1): point[i][0]+=1 while 1: try: n = input() print point[team[n]][0] except EOFerror: break
a.cc:1:1: error: 'team' does not name a type 1 | team = [0 for i in range(101)] | ^~~~
s907526138
p00061
C++
#include <algorithm> #include <cstdio> using namespace std; int main(void){ pair<int,int> p[100]; int num,point,i = 0; while(1){ scanf("%d,%d" ,&num ,&point); if(num == 0 && point == 0) break; p[i] = make_pair(-point,num); i++; } sort(p,p+i); int key; while(cin >> key){ int cnt = 1; for(int j = 1 ; p[j].second!=key ; j++){ if((-1)*p[j].first != (-1)*p[j-1].first) cnt++; } cout << cnt << endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:9: error: 'cin' was not declared in this scope 20 | while(cin >> key){ | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <cstdio> +++ |+#include <iostream> 3 | using namespace std; a.cc:25:5: error: 'cout' was not declared in this scope 25 | cout << cnt << endl; | ^~~~ a.cc:25:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:25:20: error: 'endl' was not declared in this scope 25 | cout << cnt << endl; | ^~~~ a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 2 | #include <cstdio> +++ |+#include <ostream> 3 | using namespace std;
s886994645
p00061
C++
#include <algorithm> using namespace std; int main(void){ pair<int,int> p[101]; int num,point,i = 0; char cm; while(1){ cin >> num >> cm >> point; if(num == 0 && point == 0) break; p[i] = make_pair(-point,num); i++; } sort(p,p+i); int key; while(cin >> key){ int cnt = 1; for(int j = 1 ; p[j].second!=key ; j++){ if((-1)*p[j].first != (-1)*p[j-1].first) cnt++; } cout << cnt << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'cin' was not declared in this scope 10 | cin >> num >> cm >> point; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <algorithm> +++ |+#include <iostream> 2 | using namespace std; a.cc:20:9: error: 'cin' was not declared in this scope 20 | while(cin >> key){ | ^~~ a.cc:20:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:25:5: error: 'cout' was not declared in this scope 25 | cout << cnt << endl; | ^~~~ a.cc:25:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:25:20: error: 'endl' was not declared in this scope 25 | cout << cnt << endl; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include <algorithm> +++ |+#include <ostream> 2 | using namespace std;
s674607805
p00061
C++
#include<iostream> #include<vector> #include<map> #include<string> #include<cstdio> using namespace std; typedef pair<int,int>pii; int main(void){ map<int,int>mp; vector<pii>v; while(true){ int a,b; scanf("%d,%d",&a,&b); if(a==0 && b==0)break; v.push_back(pii(b,a)); } sort(v.begin(),v.end()); reverse(v.begin(),v.end()); int k=1; for(int i=0;i<v.size();i++){ mp[v[i].second]=k; if(v[i].first!=v[i+1].first)k++; } int n; while(cin >> n){ cout << mp[n] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:9: error: 'sort' was not declared in this scope; did you mean 'short'? 21 | sort(v.begin(),v.end()); | ^~~~ | short a.cc:22:9: error: 'reverse' was not declared in this scope 22 | reverse(v.begin(),v.end()); | ^~~~~~~
s950838339
p00062
Java
import java.util.Scanner; public class J0062{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[] nums = new int[10]; while(sc.hasNext()){ String s = sc.next(); for(int i=0; i<10; i++) nums[i] = Integer.parseInt("" + s.charAt(i)); for(int i=0; i<9; i++){ for(int j=0; j<9-i; j++){ nums[j] = (nums[j] + nums[j+1])%10; } } System.out.println(nums[0]); } } }
Main.java:3: error: class J0062 is public, should be declared in a file named J0062.java public class J0062{ ^ 1 error
s363952918
p00062
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ int[] a = new int[10]; char[] s = sc.next().toCharArray(); for(int i=0;i<10;i++)a[i]=s[i]-'0'; for(int j=9;j>0;j--){ int[] b = new int[j]; for(int i=0;i<j;i++){ b[i]=(a[i]+a[i+1])%10; } a = b; } System.out.println(a[0]); }
Main.java:19: error: reached end of file while parsing } ^ 1 error
s197043748
p00062
Java
package main; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; public class WhatIsBottommost { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); while(sc.hasNext()){ String line = sc.nextLine(); int[] carray = new int[line.length()]; for(int i = 0 ;i<line.length();i++){ carray[i] = Character.getNumericValue(line.charAt(i)); } for(int i=line.length();i>0;i--){ int array[] = new int[i-1]; for(int j = 0 ; j < i-1;j++){ array[j] = (carray[j] + carray[j+1])%10; } if(i ==2){ System.out.println(array[0]); break; } carray = array; } } } }
Main.java:7: error: class WhatIsBottommost is public, should be declared in a file named WhatIsBottommost.java public class WhatIsBottommost { ^ 1 error
s127322329
p00062
Java
import java.util.Scanner; public class aoj0062 { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int[] a = new int[10]; String str;; while(scan.hasNext()){ str = scan.next(); char[] ch = str.toCharArray(); for(int i = 0; i < 10; i++){ a[i] = Integer.parseInt("" + ch[i]); } for(int i = 0; i < 9; i++){ for(int j = 0; j < 9 - i; j++){ a[j] = a[j] + a[j + 1]; if(a[j] >= 10)a[j] -= 10; } } System.out.println(a[0]); } } }
Main.java:3: error: class aoj0062 is public, should be declared in a file named aoj0062.java public class aoj0062 { ^ 1 error
s604943039
p00062
C
a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}}
main.c:1:1: warning: data definition has no type or storage class 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:7: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} | ^ main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int] 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} | ^~~~ main.c: In function 'main': main.c:1:9: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:1:45: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} | ^~~~~~~ main.c:1:1: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' +++ |+#include <stdio.h> 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} main.c:1:59: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} main.c:1:59: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} | ^~~~ main.c:1:59: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:1:59: error: void value not ignored as it ought to be 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} | ^~~~~~~ main.c:1:126: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} | ^~~~ main.c:1:126: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:1:131: error: passing argument 1 of 'puts' from incompatible pointer type [-Wincompatible-pointer-types] 1 | a[11],i;main(j){for(;;){for(i=11;i--;)(a[i]=getchar())+1||exit(0);for(i=10;--i;)for(j=0;j++<i;)a[j]+=a[j+1];i=(a[1]-6)%10+48;puts(&i);}} | ^~ | | | int * main.c:1:131: note: expected 'const char *' but argument is of type 'int *'
s797886849
p00062
C++
#include <bits/stdc++.h> using namespace std; int main() { char num[10][10]; while(1) { for(int i = 0; i < 10; ++i) { if(!(cin >> num[0][i])) { return 0; } num[0][i] -= '0'; } for(int i = 1; i < 10; ++i) { for(int j = 0; j < 10 - i; ++j) { num[i][j] = (num[i - 1][j] + num[i - 1][j + 1]) % 10; } } cout << (int)num[9][0] << endl; }
a.cc: In function 'int main()': a.cc:26:6: error: expected '}' at end of input 26 | } | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s789333687
p00062
C++
#include<iostream> #include<stdio.h> #include<ctype.h> #include<string> #include<cmath> #include<math.h> #include<vector> #include<stdlib.h> #include<algorithm> #include<functional> using namespace std; #define OUT cout << #define IN cin >> #define E << endl; #define FOR(i,a,b) for(int i = a;i < b;i++) char c[10]; int array[10]; int array2[10]; void input(){ FOR(i, 0, 10){ array[i] = c[i] - '0'; } } int main(){ while(IN c){ input(); for(int i = 9; i >= 0; i--){ for(int j = 0; j < i; j++){ array2[j] = (array[j] + array[j + 1]) % 10; } for(int j = 0; j < i; j++){ array[j] = array2[j]; } } OUT array[0] E } }
a.cc: In function 'void input()': a.cc:25:17: error: reference to 'array' is ambiguous 25 | array[i] = c[i] - '0'; | ^~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:20:5: note: 'int array [10]' 20 | int array[10]; | ^~~~~ a.cc: In function 'int main()': a.cc:34:46: error: reference to 'array' is ambiguous 34 | array2[j] = (array[j] + array[j + 1]) % 10; | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:20:5: note: 'int array [10]' 20 | int array[10]; | ^~~~~ a.cc:34:57: error: reference to 'array' is ambiguous 34 | array2[j] = (array[j] + array[j + 1]) % 10; | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:20:5: note: 'int array [10]' 20 | int array[10]; | ^~~~~ a.cc:37:33: error: reference to 'array' is ambiguous 37 | array[j] = array2[j]; | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:20:5: note: 'int array [10]' 20 | int array[10]; | ^~~~~ a.cc:40:21: error: reference to 'array' is ambiguous 40 | OUT array[0] E | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:20:5: note: 'int array [10]' 20 | int array[10]; | ^~~~~
s238571640
p00062
C++
#define scanf_s scanf //#define gets_s gets #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 30 int main(void) { char num[11],a; int n[10]; while (gets_s(num, 11) != NULL) { for (int i = 0; num[i] != '\0'; ++i) { a = num[i]; sscanf_s(&a, "%d", &n[i]); } for (int i = 10; i >= 1; --i) { for (int j = 0; j < i - 1; ++j) { n[j] = (n[j] + n[j + 1]) % 10; } } printf("%d\n", n[0]); } }
a.cc: In function 'int main()': a.cc:13:16: error: 'gets_s' was not declared in this scope 13 | while (gets_s(num, 11) != NULL) { | ^~~~~~ a.cc:16:25: error: 'sscanf_s' was not declared in this scope; did you mean 'scanf_s'? 16 | sscanf_s(&a, "%d", &n[i]); | ^~~~~~~~ | scanf_s
s744505214
p00062
C++
#include<iostream> #include<string> using namespace std; int main() { char ss[10]; int a[10]; while (cin >> ss) { for (int i = 0; i < 10; i++) { a[i] = ss[i] - '0'; } int x = a[0] + a[9] + (a[1] + a[8]) * 9 + (a[2] + a[4] + a[5] + a[7] ) * 6 + (a[3] + a[6]) * 4; string sa=to_string(x); reverse(sa.begin(), sa.end()); cout << sa[0] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:17: error: 'reverse' was not declared in this scope 15 | reverse(sa.begin(), sa.end()); | ^~~~~~~
s376147203
p00062
C++
Be spelling
a.cc:1:1: error: 'Be' does not name a type 1 | Be spelling | ^~
s821686299
p00062
C++
#include<iostream> #include<string> using namespace std; int main(void){ ????????int a[10]; ????????string n; ?????????? ????????while(cin>>n){ ????????????????for(int i = 0; i < 10 ; i ++ )a[i]=n[i]-'0'; ????????????????for(int i = 9; 0 < i; i --) ????????????????????????for(int j = 0 ; j <= i ; j ++) ????????????????????????????????a[j] =(a[j] + a[j+1])%10; ????????????????cout<<a[0]<<endl; ????????} }
a.cc: In function 'int main()': a.cc:5:1: error: expected primary-expression before '?' token 5 | ????????int a[10]; | ^ a.cc:5:2: error: expected primary-expression before '?' token 5 | ????????int a[10]; | ^ a.cc:5:3: error: expected primary-expression before '?' token 5 | ????????int a[10]; | ^ a.cc:5:4: error: expected primary-expression before '?' token 5 | ????????int a[10]; | ^ a.cc:5:5: error: expected primary-expression before '?' token 5 | ????????int a[10]; | ^ a.cc:5:6: error: expected primary-expression before '?' token 5 | ????????int a[10]; | ^ a.cc:5:7: error: expected primary-expression before '?' token 5 | ????????int a[10]; | ^ a.cc:5:8: error: expected primary-expression before '?' token 5 | ????????int a[10]; | ^ a.cc:5:9: error: expected primary-expression before 'int' 5 | ????????int a[10]; | ^~~ a.cc:5:9: error: expected ':' before 'int' 5 | ????????int a[10]; | ^~~ | : a.cc:5:9: error: expected primary-expression before 'int' 5 | ????????int a[10]; | ^~~ a.cc:5:9: error: expected ':' before 'int' 5 | ????????int a[10]; | ^~~ | : a.cc:5:9: error: expected primary-expression before 'int' 5 | ????????int a[10]; | ^~~ a.cc:5:9: error: expected ':' before 'int' 5 | ????????int a[10]; | ^~~ | : a.cc:5:9: error: expected primary-expression before 'int' 5 | ????????int a[10]; | ^~~ a.cc:5:9: error: expected ':' before 'int' 5 | ????????int a[10]; | ^~~ | : a.cc:5:9: error: expected primary-expression before 'int' 5 | ????????int a[10]; | ^~~ a.cc:5:9: error: expected ':' before 'int' 5 | ????????int a[10]; | ^~~ | : a.cc:5:9: error: expected primary-expression before 'int' 5 | ????????int a[10]; | ^~~ a.cc:5:9: error: expected ':' before 'int' 5 | ????????int a[10]; | ^~~ | : a.cc:5:9: error: expected primary-expression before 'int' 5 | ????????int a[10]; | ^~~ a.cc:5:9: error: expected ':' before 'int' 5 | ????????int a[10]; | ^~~ | : a.cc:5:9: error: expected primary-expression before 'int' 5 | ????????int a[10]; | ^~~ a.cc:5:9: error: expected ':' before 'int' 5 | ????????int a[10]; | ^~~ | : a.cc:5:9: error: expected primary-expression before 'int' 5 | ????????int a[10]; | ^~~ a.cc:6:1: error: expected primary-expression before '?' token 6 | ????????string n; | ^ a.cc:6:2: error: expected primary-expression before '?' token 6 | ????????string n; | ^ a.cc:6:3: error: expected primary-expression before '?' token 6 | ????????string n; | ^ a.cc:6:4: error: expected primary-expression before '?' token 6 | ????????string n; | ^ a.cc:6:5: error: expected primary-expression before '?' token 6 | ????????string n; | ^ a.cc:6:6: error: expected primary-expression before '?' token 6 | ????????string n; | ^ a.cc:6:7: error: expected primary-expression before '?' token 6 | ????????string n; | ^ a.cc:6:8: error: expected primary-expression before '?' token 6 | ????????string n; | ^ a.cc:6:16: error: expected primary-expression before 'n' 6 | ????????string n; | ^ a.cc:6:15: error: expected ':' before 'n' 6 | ????????string n; | ^~ | : a.cc:6:16: error: 'n' was not declared in this scope 6 | ????????string n; | ^ a.cc:6:17: error: expected ':' before ';' token 6 | ????????string n; | ^ | : a.cc:6:17: error: expected primary-expression before ';' token a.cc:6:17: error: expected ':' before ';' token 6 | ????????string n; | ^ | : a.cc:6:17: error: expected primary-expression before ';' token a.cc:6:17: error: expected ':' before ';' token 6 | ????????string n; | ^ | : a.cc:6:17: error: expected primary-expression before ';' token a.cc:6:17: error: expected ':' before ';' token 6 | ????????string n; | ^ | : a.cc:6:17: error: expected primary-expression before ';' token a.cc:6:17: error: expected ':' before ';' token 6 | ????????string n; | ^ | : a.cc:6:17: error: expected primary-expression before ';' token a.cc:6:17: error: expected ':' before ';' token 6 | ????????string n; | ^ | : a.cc:6:17: error: expected primary-expression before ';' token a.cc:6:17: error: expected ':' before ';' token 6 | ????????string n; | ^ | : a.cc:6:17: error: expected primary-expression before ';' token a.cc:7:1: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:7:2: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:7:3: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:7:4: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:7:5: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:7:6: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:7:7: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:7:8: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:7:9: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:7:10: error: expected primary-expression before '?' token 7 | ?????????? | ^ a.cc:8:1: error: expected primary-expression before '?' token 8 | ????????while(cin>>n){ | ^ a.cc:8:2: error: expected primary-expression before '?' token 8 | ????????while(cin>>n){ | ^ a.cc:8:3: error: expected primary-expression before '?' token 8 | ????????while(cin>>n){ | ^ a.cc:8:4: error: expected primary-expression before '?' token 8 | ????????while(cin>>n){ | ^ a.cc:8:5: error: expected primary-expression before '?' token 8 | ????????while(cin>>n){ | ^ a.cc:8:6: error: expected primary-expression before '?' token 8 | ????????while(cin>>n){ | ^ a.cc:8:7: error: expected primary-expression before '?' token 8 | ????????while(cin>>n){ | ^ a.cc:8:8: error: expected primary-expression before '?' token 8 | ????????while(cin>>n){ | ^ a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ | ^~~~~ a.cc:8:9: error: expected ':' before 'while' 8 | ????????while(cin>>n){ | ^~~~~ | : a.cc:8:9: error: expected primary-expression before 'while' 8 | ????????while(cin>>n){ |
s048242249
p00062
C++
#include<cstdio> int main(){char s[11],a,i;while(gets(s)){for(a=9;a>=0;a--)for(i=0;i<a;s[i]=(s[i]+s[i+1]-6)%10+48,i++);printf("%c\n",*s);}}
a.cc: In function 'int main()': a.cc:2:33: error: 'gets' was not declared in this scope; did you mean 'getw'? 2 | int main(){char s[11],a,i;while(gets(s)){for(a=9;a>=0;a--)for(i=0;i<a;s[i]=(s[i]+s[i+1]-6)%10+48,i++);printf("%c\n",*s);}} | ^~~~ | getw
s084137422
p00062
C++
#include <iostream> #include <cstdio> #include <vector> using namespace std; int main() { vector<int> a(10); while (scanf("%d ", a) == 1) { for (int i = 1; i < 10; i++) { scanf("%d ", &a[i]); } for (int i = 9; i >= 1; i--) { vector<int> b(i); for (int j = 0; j < i; j++) { b[j] = (a[j] + a[j + 1]) % 10; } a = b; } printf("%d\n", a[0]); } return 0;
a.cc: In function 'int main()': a.cc:23:12: error: expected '}' at end of input 23 | return 0; | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s094549798
p00062
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<cassert> #include<iostream> #include<sstream> #include<string> #include<vector> #include<queue> #include<set> #include<map> #include<utility> #include<numeric> #include<algorithm> #include<bitset> #include<complex> using namespace std; typedef long long Int; typedef vector<int> vint; typedef pair<int,int> pint; #define mp make_pair template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; } template<class T> void chmin(T &t, T f) { if (t > f) t = f; } template<class T> void chmax(T &t, T f) { if (t < f) t = f; } int in() { int x; scanf("%d", &x); return x; } Int abs(Int n){ return (n>=0)?n:-n; } int main() { Int n; for(;cin>>n;){ Int m,pow; int i,j; for(i=10;i>1;i--){ pow=1; m=0; for(j=0;j<i-1;j++){ m+=abs(n/pow%10+n/pow/10%10)%10*pow; pow*=10; } n=m; } cout<<n<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:44:39: error: call of overloaded 'abs(Int)' is ambiguous 44 | m+=abs(n/pow%10+n/pow/10%10)%10*pow; | ~~~^~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdlib:79, from a.cc:2: /usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' 980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur; | ^~~ a.cc:31:5: note: candidate: 'Int abs(Int)' 31 | Int abs(Int n){ | ^~~ In file included from /usr/include/c++/14/cstdlib:81: /usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)' 137 | abs(__float128 __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' 85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; } | ^~~ /usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)' 79 | abs(long double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)' 75 | abs(float __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)' 71 | abs(double __x) | ^~~ /usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' 61 | abs(long long __x) { return __builtin_llabs (__x); } | ^~~ /usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' 56 | abs(long __i) { return __builtin_labs(__i); } | ^~~
s732783473
p00062
C++
4823108376 1234567890 0123456789
a.cc:3:1: error: invalid digit "9" in octal constant 3 | 0123456789 | ^~~~~~~~~~ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 4823108376 | ^~~~~~~~~~
s346940876
p00062
C++
top[11]; for(int i = 0; i <10; i++) { cin >> top[i]; tri[0][i] = top[i] - '0'; //printf("%d ",tri[0][i]); } int cont = 1; for(int i = 9; i > 0; i--){ for(int j = 0; j < i; j++){ if(tri[cont-1][j] + tri[cont-1][j+1] > 9) tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1] -10 ; else tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1]; //printf("%d ",tri[cont][j]); } cont++; //puts(""); } cout << tri[9][0] << endl; }
a.cc:1:1: error: 'top' does not name a type 1 | top[11]; | ^~~ a.cc:2:5: error: expected unqualified-id before 'for' 2 | for(int i = 0; i <10; i++) | ^~~ a.cc:2:20: error: 'i' does not name a type 2 | for(int i = 0; i <10; i++) | ^ a.cc:2:27: error: 'i' does not name a type 2 | for(int i = 0; i <10; i++) | ^ a.cc:9:5: error: expected unqualified-id before 'for' 9 | for(int i = 9; i > 0; i--){ | ^~~ a.cc:9:20: error: 'i' does not name a type 9 | for(int i = 9; i > 0; i--){ | ^ a.cc:9:27: error: 'i' does not name a type 9 | for(int i = 9; i > 0; i--){ | ^ a.cc:19:5: error: 'cout' does not name a type 19 | cout << tri[9][0] << endl; | ^~~~ a.cc:20:1: error: expected declaration before '}' token 20 | } | ^
s259951588
p00062
C++
= 0; i <10; i++) { cin >> top[i]; tri[0][i] = top[i] - '0'; //printf("%d ",tri[0][i]); } int cont = 1; for(int i = 9; i > 0; i--){ for(int j = 0; j < i; j++){ if(tri[cont-1][j] + tri[cont-1][j+1] > 9) tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1] -10 ; else tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1]; //printf("%d ",tri[cont][j]); } cont++; //puts(""); } cout << tri[9][0] << endl; }
a.cc:1:1: error: expected unqualified-id before '=' token 1 | = 0; i <10; i++) | ^ a.cc:1:6: error: 'i' does not name a type 1 | = 0; i <10; i++) | ^ a.cc:1:13: error: 'i' does not name a type 1 | = 0; i <10; i++) | ^ a.cc:8:5: error: expected unqualified-id before 'for' 8 | for(int i = 9; i > 0; i--){ | ^~~ a.cc:8:20: error: 'i' does not name a type 8 | for(int i = 9; i > 0; i--){ | ^ a.cc:8:27: error: 'i' does not name a type 8 | for(int i = 9; i > 0; i--){ | ^ a.cc:18:5: error: 'cout' does not name a type 18 | cout << tri[9][0] << endl; | ^~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s363101984
p00062
C++
= 0; i <10; i++) { cin >> top[i]; tri[0][i] = top[i] - '0'; //printf("%d ",tri[0][i]); } int cont = 1; for(int i = 9; i > 0; i--){ for(int j = 0; j < i; j++){ if(tri[cont-1][j] + tri[cont-1][j+1] > 9) tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1] -10 ; else tri[cont][j] = tri[cont-1][j] + tri[cont-1][j+1]; //printf("%d ",tri[cont][j]); } cont++; //puts(""); } cout << tri[9][0] << endl; }
a.cc:1:1: error: expected unqualified-id before '=' token 1 | = 0; i <10; i++) | ^ a.cc:1:6: error: 'i' does not name a type 1 | = 0; i <10; i++) | ^ a.cc:1:13: error: 'i' does not name a type 1 | = 0; i <10; i++) | ^ a.cc:8:5: error: expected unqualified-id before 'for' 8 | for(int i = 9; i > 0; i--){ | ^~~ a.cc:8:20: error: 'i' does not name a type 8 | for(int i = 9; i > 0; i--){ | ^ a.cc:8:27: error: 'i' does not name a type 8 | for(int i = 9; i > 0; i--){ | ^ a.cc:18:5: error: 'cout' does not name a type 18 | cout << tri[9][0] << endl; | ^~~~ a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s234859477
p00062
C++
int main(){ string s; int num[10]; int k[10][12] = {0}; k[0][1] = 1; for(int i = 1; i < 10; i++){ for(int j = 1; j < 12; j++){ k[i][j] = k[i-1][j-1]+k[i-1][j]; } } while(cin >> s){ if(s == "0")break; int sum = 0; for(int i = 0; i < s.size(); i++){ sum += (s[i]-'0')*k[9][i+1]; } cout << sum%10 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:2:9: error: 'string' was not declared in this scope 2 | string s; | ^~~~~~ a.cc:15:15: error: 'cin' was not declared in this scope 15 | while(cin >> s){ | ^~~ a.cc:15:22: error: 's' was not declared in this scope 15 | while(cin >> s){ | ^ a.cc:22:17: error: 'cout' was not declared in this scope 22 | cout << sum%10 << endl; | ^~~~ a.cc:22:35: error: 'endl' was not declared in this scope 22 | cout << sum%10 << endl; | ^~~~
s332977092
p00062
C++
#include <iostream> #include <string> using namespace std; int main(){ string str; while(cin>>str){ int num[10]; for(int i=0;i<10;i++){ num[i]=str[i]-48; } for(int j=9;j>=0;j--){ for(int k=0;k<j;k++){ num[k] += num[k+1]; } } cout<<num[k]%10<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:27: error: 'k' was not declared in this scope 16 | cout<<num[k]%10<<endl; | ^
s576177225
p00063
Java
import java.io.*; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { public static void main(String[] args) { FastScanner sc = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int count = 0; while(sc.hasNext()) { String a = sc.next(); String b = new StringBuffer(a).reverse().toString(); if(a.equals(b)) { count++; } } out.println(count); out.flush(); } //------------------------------// //-----------// class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private boolean hasNextByte() { if (ptr < buflen) { return true; }else{ ptr = 0; try { buflen = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;} private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;} private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;} public boolean hasNext() { skipUnprintable(); return hasNextByte();} public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while(isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while(true){ if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; }else if(b == -1 || !isPrintableChar(b)){ return minus ? -n : n; }else{ throw new NumberFormatException(); } b = readByte(); } } }
Main.java:89: error: reached end of file while parsing } ^ 1 error
s473456086
p00063
Java
port java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); int cnt = 0; int dataset = 50; String[] str = new String[dataset]; for(int i = 0; i < dataset; i++){ try { str[i] = input.readLine(); } catch (IOException e) { // TODO ????????????????????? catch ???????????? e.printStackTrace(); } } for(int j = 0; j < dataset; j++) { StringBuffer sb = new StringBuffer(str[j]); if(str[j].equals(sb.reverse().toString())) { cnt++; } } System.out.println(cnt); } }
Main.java:1: error: class, interface, enum, or record expected port 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; ^ Main.java:4: error: class, interface, enum, or record expected import java.util.Scanner; ^ 4 errors
s094361881
p00063
Java
port java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); int cnt = 0; int dataset = 50; String[] str = new String[dataset]; for(int i = 0; i < dataset; i++){ try { str[i] = input.readLine(); } catch (IOException e) { // TODO ????????????????????? catch ???????????? e.printStackTrace(); } } for(int j = 0; j < dataset; j++) { StringBuffer sb = new StringBuffer(str[j]); if(str[j].equals(sb.reverse().toString())) { cnt++; } } System.out.println(cnt); } }
Main.java:1: error: class, interface, enum, or record expected port 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; ^ Main.java:4: error: class, interface, enum, or record expected import java.util.Scanner; ^ 4 errors
s537094572
p00063
Java
#include<iostream> #include<math.h> #include<vector> #include<algorithm> #include<cstdio> #include<string> using namespace std; int main() { string s; int n, i; n = 0; while (cin>>s) { n++; for (i = 0; i < s.size()/2; i++) { if (s[i] != s[s.size()-i-1]) { n--; break; } } } cout<<n<<endl; return 0; }
Main.java:1: error: illegal character: '#' #include<iostream> ^ Main.java:2: error: illegal character: '#' #include<math.h> ^ Main.java:3: error: illegal character: '#' #include<vector> ^ Main.java:4: error: illegal character: '#' #include<algorithm> ^ Main.java:5: error: illegal character: '#' #include<cstdio> ^ Main.java:6: error: illegal character: '#' #include<string> ^ Main.java:23: error: not a statement cout<<n<<endl; ^ Main.java:9: error: unnamed classes are a preview feature and are disabled by default. int main() ^ (use --enable-preview to enable unnamed classes) 8 errors
s609834589
p00063
Java
ipmport java.util.Scanner; public class Main { public static void main(String arg[]) { Scanner sc = new Scanner(System.in); int count =0; while(sc.hasNext()) { String str = sc.next(); for(int i=0; i<str.length(); i++) { if(str.charAt(i)==str.charAt(str.length()-1-i)) { if(str.length()-1-i<= i) { count++; break; } continue; } else break; } } System.out.println(count); } }
Main.java:1: error: class, interface, enum, or record expected ipmport java.util.Scanner; ^ 1 error
s048708466
p00063
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = 0; while(sc.hasNext()){ String s = sc.next(); if(s.equals((new StringBuffer(s)).reverse().toString()))n++; } System.out.println(c); } }
Main.java:12: error: cannot find symbol System.out.println(c); ^ symbol: variable c location: class Main 1 error
s094599501
p00063
C
#include<stdio.h> #include<string.h> int main(){ int l,c=0; char s[102]={0}; while(~scanf("%s",s)){ for(i=1;s[i];i++); for(j=0;j>=i;j++){ if(s[i]-s[j])break; i--; } if(j<i)c++; } printf("%d",c); return 0; }
main.c: In function 'main': main.c:7:9: error: 'i' undeclared (first use in this function) 7 | for(i=1;s[i];i++); | ^ main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in main.c:8:9: error: 'j' undeclared (first use in this function) 8 | for(j=0;j>=i;j++){ | ^
s873460399
p00063
C
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; int main(void) { int c, n = 0; char s1[100], s2[100]; while (scanf("%s", s1) != EOF){ c = 0; for (int i = 0; i <= strlen(s1); i++){ s2[i] = s1[i]; } reverse(s2, s2 + strlen(s1)); for (int i = 0; i <= strlen(s1); i++){ if (s1[i] == s2[i]){ c++; if (c == strlen(s1)){ n++; } } } } printf("%d\n", n); return (0); }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s624338897
p00063
C
#include <stdio.h> #include <string.h> int main(void) { char a[101]; int c=0,l; while(scanf("%s",a)!=EOF){ l=strlen(a); int i,f=1; for(i=0;i<l/2;i++){ if(a[i]!=a[l-1-i])) f=0; break; } if(f) c++; } printf("%d\n",c); return 0; }
main.c: In function 'main': main.c:11:25: error: expected statement before ')' token 11 | if(a[i]!=a[l-1-i])) | ^
s596680907
p00063
C
#include <stdio.h> #include <string.h> int main(){ char x[105]; int i,j,num,sum; while(scanf("%s",x)!=EOF){ int c=strlen(x); for(i=0;i<c/2;i++){ if(x[i]!=x[c-1-i]){ num=1; }}} if(num==0) sum++; num=0; printf("%d\n",sum); sum=0; } return 0; }
main.c:17:1: error: expected identifier or '(' before 'return' 17 | return 0; | ^~~~~~ main.c:18:1: error: expected identifier or '(' before '}' token 18 | } | ^
s434628298
p00063
C++
#include<cstdio> #include<algorithm> #include<vector> #include<string> #include<iostream> #include<queue> #include<map> #include<set> #include<complex> #include<stack> #include<cmath> using namespace std; #define reps(i,f,n) for(int i=f;i<int(n);i++) #define rep(i,n) reps(i,0,n) int main(){ string s; int cnt=0; while(cin>>s){ int a = 0; bool ok = true; rep(i,s.size())if(s[i]!=s[s.size()-i-1])ok=false; if(ok)cnt++; } printf("%d\n",cnt): }
a.cc: In function 'int main()': a.cc:30:27: error: expected ';' before ':' token 30 | printf("%d\n",cnt): | ^ | ;
s195129203
p00063
C++
#include <stdio.h> int main(void) { char c[200]; int ans = 0; int len; while(scanf("%s", c) != EOF){ len = strlen(c); ans++; for(int i = 0; i < len / 2; i++){ if(c[i] != c[len - i - 1]){ ans--; break; } } } printf("%d\n",ans); return 0; }
a.cc: In function 'int main()': a.cc:9:23: error: 'strlen' was not declared in this scope 9 | len = strlen(c); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> +++ |+#include <cstring> 2 |
s602991023
p00063
C++
#include<iostream> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<vector> #include<cmath> #include<cstring> #include<cstdio> #include<time.h> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define rp(a) while(a--) #define pb push_back #define mp make_pair #define all(in) in.begin(),in.end() const double PI=acos(-1); const double EPS=1e-10; using namespace std; typedef long long ll; typedef vector<int> vi; int main(){ string s; int out=0; while(cin>>s){ tmp=s; reverse(all(tmp)); if(s==tmp)out++; } cout<<out<<endl; }
a.cc: In function 'int main()': a.cc:27:17: error: 'tmp' was not declared in this scope; did you mean 'tm'? 27 | tmp=s; | ^~~ | tm
s136597557
p00063
C++
#include <iostream> #include <vector> #include <cstdio> #include <string> using namespace std; int main(){ string a; //int n; int k=0; //cin>>n; while(cin>>a){ //cin>>a; int f=0; //cout<<a.size()/2<<endl; for(int i=0;i<a.size()/2;i++){ //cout<<a[i]<<a[a.size()-1-i]<<endl; if(a[i]!=a[a.size()-1-i]) f=1; } if(f==0) k++; n--; } cout<<k<<endl; }
a.cc: In function 'int main()': a.cc:24:17: error: 'n' was not declared in this scope 24 | n--; | ^
s636346641
p00063
C++
s = 0 while a = gets a.chop! f = 1 a.size.times{|i| f = 0 if a[i] != a[~i] } s += f end p s
a.cc:1:1: error: 's' does not name a type 1 | s = 0 | ^ a.cc:8:9: error: 's' does not name a type 8 | s += f | ^
s403943487
p00063
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) for (int i = 0; i < (n); i++) #define sz(obj) ((int)(obj).size()) int main() { string str; int cnt = 0; while (cin >> str){ REP(i, sz(str) / 2) if (str[i] == str[sz(str) - (i + 1)]) ccnt++; if (ccnt == sz(str) / 2) cnt++; cout << cnt << endl; } }
a.cc: In function 'int main()': a.cc:13:63: error: 'ccnt' was not declared in this scope; did you mean 'cnt'? 13 | REP(i, sz(str) / 2) if (str[i] == str[sz(str) - (i + 1)]) ccnt++; | ^~~~ | cnt a.cc:14:9: error: 'ccnt' was not declared in this scope; did you mean 'cnt'? 14 | if (ccnt == sz(str) / 2) cnt++; | ^~~~ | cnt
s271964130
p00063
C++
#include<cstdio> #include<iostream> #include<cmath> #include<vector> #include<string> #include<algorithm> #define ll long long #define LL long long #define ULL unsigned long long #define ull unsigned long long #define FOR(i,a,b) for(int i=a;i<b;i++) #define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--) #define REP(i,n) for(int i=0;i<n;i++) #define RREP(i,n) for(int i=(n)-1;i>=0;i--) using namespace std; int main() { char str[110] = {}; int len; bool flag = true; int count = 0; while (cin >> str) { len=strlen(str); if (len % 2 != 0) { for (int i = 0; i < (len - 1)/2; i++) { if (str[i] != str[(len - 1) - i]) { flag = false; } } if (flag == true) { count++; } } else { } } cout << count << endl; return 0; }
a.cc: In function 'int main()': a.cc:27:21: error: 'strlen' was not declared in this scope 27 | len=strlen(str); | ^~~~~~ a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include<algorithm> +++ |+#include <cstring> 7 |
s300440609
p00063
C++
#include <iostream> #include <string> using namespace std; int main(){ string a; int count = 0; while(cin >> a;){ string b = a; reverse(b.begin(),b.end()); if(a == b) count++; } cout << count << "\n"; }
a.cc: In function 'int main()': a.cc:8:23: error: expected ')' before ';' token 8 | while(cin >> a;){ | ~ ^ | ) a.cc:8:24: error: expected primary-expression before ')' token 8 | while(cin >> a;){ | ^
s066285902
p00063
C++
#include <iostream> #include <string> using namespace std; int main(){ string a; int count = 0; while(cin >> a){ string b = a; reverse(b.begin(),b.end()); if(a == b) count++; } cout << count << "\n"; }
a.cc: In function 'int main()': a.cc:10:17: error: 'reverse' was not declared in this scope 10 | reverse(b.begin(),b.end()); | ^~~~~~~
s885564848
p00063
C++
//#define scanf_s scanf #define gets_s gets #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 51 int main(void) { char str[MAX]; int i, j, cou = 0; while (scanf_s("%s",str) != EOF) { ++cou; for (i = 0; str[i] != '\0'; ++i); for (j = 0; j < i / 2; ++j) { if (str[j] != str[i - 1 - j]) { --cou; break; } } } printf("%d\n", cou); }
a.cc: In function 'int main()': a.cc:13:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | while (scanf_s("%s",str) != EOF) { | ^~~~~~~ | scanf
s507556533
p00063
C++
#include <iostream> #include <string> #include <stdio.h> using namespace std; int main(){ string s,sans1,sans2; char s1[100] , s2[100]; int ssum; int sum = 0; while(1){ scanf("%s" , s); if(s == EOF) break; ssum = s.size() / 2; for(int i = 0; i < ssum; i++){ s1[i] = s[i]; s2[i] = s[s.size() - i - 1]; } //for(int j = s.size(); j > ssum; j--){ // s2[j] = s[j]; cout << s1 << endl; cout << s2 << endl; sans1 = s1; sans2 = s2; if(sans1 == sans2){ sum++; } } cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:22: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 18 | if(s == EOF) break; | ~ ^~ | | | std::string {aka std::__cxx11::basic_string<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:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)' 192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed: 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, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: a.cc:18:25: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 18 | if(s == EOF) break; | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)' 235 | operator==(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed: a.cc:18:25: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 18 | if(s == EOF) break; | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 441 | operator==(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed: a.cc:18:25: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | if(s == EOF) break; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 486 | operator==(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed: a.cc:18:25: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | if(s == EOF) break; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1667 | operator==(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed: a.cc:18:25: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | if(s == EOF) break; | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1737 | operator==(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed: a.cc:18:25: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | if(s == EOF) break; | ^~~ 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:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed: a.cc:18:25: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 18 | if(s == EOF) break; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /usr/include/c++/14/string_view:629: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> >)' 629 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed: a.cc:18:25: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | if(s == EOF) break; | ^~~ /usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 637 | operator==(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed: a.cc:18:25: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | if(s == EOF) break; | ^~~ /usr/include/c++/14/string_view:644: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>)' 644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed: a.cc:18:25: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 18 | if(s == EOF) break; | ^~~ /usr/include/c++/14/bits/basic_string.h:3755: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>&)' 3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed: a.cc:18:25: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 18 | if(s == EOF) break; | ^~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed: a.cc:18:25: note: mismatched types 'const _CharT*' and 'int' 18 | if(s == EOF) break; | ^~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3819 | operator==(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed: a.cc:18:25: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 18 | if(s == EOF) break; | ^~~ 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:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2558 | operator==(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed: a.cc:18:25: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 18 | if(s == EOF) break; | ^~~ 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:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed: a.cc:18:25:
s995634093
p00063
C++
#include <iostream> #include <string> using namespace std; int main(){ string s,g; int k=0; while(cin>>s){ g=s; reverse(s.begin() , s.end() ); if(g==s)k++; } cout<<k<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'reverse' was not declared in this scope 10 | reverse(s.begin() , s.end() ); | ^~~~~~~
s050231361
p00063
C++
#include <iostream> #include <string> using namespace std; int main(){ string s,g; int k=0; while(cin>>s){ g=s; reverse(s.begin() , s.end() ); if(g==s)k++; } cout<<k<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'reverse' was not declared in this scope 10 | reverse(s.begin() , s.end() ); | ^~~~~~~
s103267101
p00063
C++
#include <iostream> #include <string> using namespace std; int main(){ string s,g; int k=0; while(cin>>s){ g=s; reverse(s.begin() , s.end() ); if(g==s)k++; } cout<<k<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'reverse' was not declared in this scope 10 | reverse(s.begin() , s.end() ); | ^~~~~~~
s822879604
p00063
C++
#include<iostream> #include<string> using namespace std; int main() { string sa; int co = 0; while (cin >> sa) { int a = sa.size(); if (a == 1) { co++; } string sb, sc; for (int i = 0; i < a / 2; i++) { sb[i] = sa[i]; } int j = 0; if (a % 2 == 0) { for (int i = a / 2 + 1; i < a; i++) { sc[j] = sa[i]; j++; } } else { for (int i = 0; i < a;i++) { sc[j] = sa[i+(a/2)]; } } reverse(sc.begin(),sc.end()); if (sb == sc) {++co; } } cout << co << endl; return 0; }
a.cc: In function 'int main()': a.cc:28:17: error: 'reverse' was not declared in this scope 28 | reverse(sc.begin(),sc.end()); | ^~~~~~~
s420747207
p00063
C++
#include <iostream> #include <string> using namespace std; int main() { string st; string origin; int cnt = 0; while (cin >> st) { origin = st; reverse(st.begin(), st.end()); if (st == origin) cnt++; } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'reverse' was not declared in this scope 12 | reverse(st.begin(), st.end()); | ^~~~~~~
s313573310
p00063
C++
#include <iostream> #include <string> using namespace std; int main() { string st; string origin; int cnt = 0; while (cin >> st) { origin = st; reverse(st.begin(), st.end()); if (st == origin) cnt++; } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'reverse' was not declared in this scope 12 | reverse(st.begin(), st.end()); | ^~~~~~~
s693464040
p00063
C++
#include <iostream> #include <string> using namespace std; int main() { string s,t; int n=0; while(cin >> s) { t=s; reverse(t.begin(), t.end()); if(s==t)n++; } cout << n << endl; }
a.cc: In function 'int main()': a.cc:12:17: error: 'reverse' was not declared in this scope 12 | reverse(t.begin(), t.end()); | ^~~~~~~
s495592828
p00063
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ char ss[100]; int i,c; c=0; while(0<=scanf("%s",ss)){ /* for(i=0;i<=strlen(ss)-1;i++){ if(ss[i]!=ss[strlen(ss)-i-1])break; } if(i==strlen(ss)-1)++c; } */ printf("%d\n",c); return 0; }
a.cc: In function 'int main()': a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s534832107
p00063
C++
#include <iostream> #include <string> using namespace std; int main(){ string pal; int count = 0; while(cin >> pal){ bool ispalin = true; int l = pal.length; for(int i=0;i*2 < l-1;i++) if(pal[i] != pal[l-1-i]) {ispalin = false;break;} if(ispalin) count++; } cout << count << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:29: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int' 12 | int l = pal.length; | ^~~~~~
s935310648
p00063
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int main() { string str; int c = 0; while (cin >> str) { cin.ignore(); string S, R; S = substr(0, str.size() / 2); if (str.size() % 2 == 0) { R = substr(str.size() / 2, str.size() / 2); } else { R = substr(str.size() / 2 + 1, str.size() / 2); } if (S == R) {c++;} } printf("%d\n", c); return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: 'substr' was not declared in this scope 14 | S = substr(0, str.size() / 2); | ^~~~~~
s650237680
p00063
C++
#include <stdio.h> int main(){ int i,len,cnt=0; char input[1000]; while(scanf("%s",input)!=EOF){ if(input==EOF)break; len=strlen(input); int sw=1; for(i=0;i<len/2;i++){ if(input[i]!=input[len-1-i]){ sw=0; break; } } if(sw==1)cnt++; } printf("%d\n",cnt); return 0; }
a.cc: In function 'int main()': a.cc:6:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 6 | if(input==EOF)break; | ^ a.cc:7:13: error: 'strlen' was not declared in this scope 7 | len=strlen(input); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> +++ |+#include <cstring> 2 | int main(){
s282420321
p00063
C++
include <iostream> #include <stdio.h> #include <string.h> using namespace std; int main() { char a[101]; int s,cn=0,i,f; while (cin >> a) { s=strlen(a); f=0; for (i=0;i<(s+1)/2;i++) if (a[i]!=a[s-1-i]) f=1; if (f==0) cn++; } cout << cn << endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from a.cc:3: /usr/include/string.h:44:22: error: 'size_t' has not been declared 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:47:56: error: 'size_t' has not been declared 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: error: 'size_t' has not been declared 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:61:42: error: 'size_t' has not been declared 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:64:56: error: 'size_t' has not been declared 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: error: 'size_t' has not been declared 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:87:42: error: 'size_t' has not been declared 87 | extern void *memchr (void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:89:54: error: 'size_t' has not been declared 89 | extern const void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:126:49: error: 'size_t' has not been declared 126 | extern "C++" void *memrchr (void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:129:61: error: 'size_t' has not been declared 129 | extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: error: 'size_t' has not been declared 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:153:23: error: 'size_t' has not been declared 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:159:57: error: 'size_t' has not been declared 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:166:8: error: 'size_t' does not name a type 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 33 | #include <stddef.h> +++ |+#include <cstddef> 34 | /usr/include/string.h:179:8: error: 'size_t' does not name a type 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 '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:195:45: error: 'size_t' has not been declared 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:293:8: error: 'size_t' does not name a type 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:297:8: error: 'size_t' does not name a type 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:389:46: error: 'size_t' has not been declared 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:390:44: error: 'size_t' has not been declared 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:398:55: error: 'size_t' has not been declared 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: error: 'size_t' has not been declared 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:407:8: error: 'size_t' does not name a type 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:413:8: error: 'size_t' does not name a type 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:444:53: error: 'size_t' has not been declared 444 | extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) | ^~~~~~ In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: 'size_t' has not been declared 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: error: 'size_t' has not been declared 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:42:31: error: 'size_t' has not been declared 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:120:61: error: 'size_t' has not been declared 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:134:27: error: 'size_t' has not been declared 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/string.h:466:40: error: 'size_t' has not been declared 466 | extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1)) | ^~~~~~ /usr/include/string.h:497:55: error: 'size_t' has not been declared 497 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:500:53: error: 'size_t' has not been declared 500 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:506:8: error: 'size_t' does not name a type 506 | extern size_t strlcpy (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:506:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:512:8: error: 'size_t' does not name a type 512 | extern size_t strlcat (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:512:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/string.h:526:34: error: 'size_t' has not been declared 526 | extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1)) | ^~~~~~ a.cc: In function 'int main()': a.cc:9:16: error: 'cin' was not declared in this scope 9 | while (cin >> a) { | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include <string.h> +++ |+#include <iostream> 4 | using namespace std; a.cc:10:8: error: 'strlen' was not declared in this scope 10 | s=strlen(a); f=0; | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <string.h> +++ |+#include <cstring> 4 | using namespace std; a.cc:14:9: error: 'cout' was not declared in this scope 14 | cout << cn << endl; | ^~~~ a.cc:14:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:14:23: error: 'endl' was not declared in this scope 14 | cout << cn << endl; | ^~~~ a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 3 | #include <string.h> +++ |+#include <ostream> 4 | using namespace std;
s892887139
p00063
C++
#include <iostream> #include <cstring> #include <string> using namespace std; int main(){ int cnt; string s; cnt = 0; while(cin >> s){ string c = s; reverse(c.begin(),c.end()); if(c == s) cnt++; } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:12:9: error: 'reverse' was not declared in this scope 12 | reverse(c.begin(),c.end()); | ^~~~~~~
s756907937
p00063
C++
#include <iostream> #include <string> using namespace std; int check(string a,string b){ if(a == b) return 1; return 0; } int main(void){ string str; int cnt = 0; while(cin >> str){ int flg = 0; for(int i = 0 ; i < str.size()/2 ; i++){ if(!check(str[i],str[str.size()-i-1]){ flg = 1; break; } } if(flg == 0) cnt++; } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:16: error: could not convert 'str.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))' from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::string' {aka 'std::__cxx11::basic_string<char>'} 18 | if(!check(str[i],str[str.size()-i-1]){ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char} a.cc:18:44: error: expected ')' before '{' token 18 | if(!check(str[i],str[str.size()-i-1]){ | ~ ^ | ) a.cc:22:5: error: expected primary-expression before '}' token 22 | } | ^
s400572437
p00063
C++
Input
a.cc:1:1: error: 'Input' does not name a type 1 | Input | ^~~~~
s608880767
p00063
C++
#include <iostream> #include <string> int main(){ char c; int a=0; std::string s,x; for(;std::cin>>s>>c;){ x=s; reverse(x.begin(),x.end()); if (x==s) a++; } std::cout<<a<<"\n"; }
a.cc: In function 'int main()': a.cc:9:17: error: 'reverse' was not declared in this scope 9 | reverse(x.begin(),x.end()); | ^~~~~~~
s463301040
p00063
C++
/** * */ import java.util.*; /** * @author akira * */ class Main { /** * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int ans = 0; while(scan.hasNextLine()){ String str = scan.nextLine(); boolean b = true; for(int i = 0;i < str.length() / 2;i++){ if(str.charAt(i) != str.charAt(str.length() - 1 - i)){ b = false; } } if(b){ ans++; } } System.out.println("" + ans); } }
a.cc:4:1: error: 'import' does not name a type 4 | import java.util.*; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:14:15: error: expected ':' before 'static' 14 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:14:33: error: 'String' has not been declared 14 | public static void main(String[] args) { | ^~~~~~ a.cc:14:42: error: expected ',' or '...' before 'args' 14 | public static void main(String[] args) { | ^~~~ a.cc:33:2: error: expected ';' after class definition 33 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:16:17: error: 'Scanner' was not declared in this scope 16 | Scanner scan = new Scanner(System.in); | ^~~~~~~ a.cc:18:23: error: 'scan' was not declared in this scope 18 | while(scan.hasNextLine()){ | ^~~~ a.cc:19:25: error: 'String' was not declared in this scope 19 | String str = scan.nextLine(); | ^~~~~~ a.cc:20:25: error: 'boolean' was not declared in this scope; did you mean 'bool'? 20 | boolean b = true; | ^~~~~~~ | bool a.cc:21:43: error: 'str' was not declared in this scope; did you mean 'std'? 21 | for(int i = 0;i < str.length() / 2;i++){ | ^~~ | std a.cc:23:41: error: 'b' was not declared in this scope 23 | b = false; | ^ a.cc:26:28: error: 'b' was not declared in this scope 26 | if(b){ | ^ a.cc:30:17: error: 'System' was not declared in this scope 30 | System.out.println("" + ans); | ^~~~~~
s123436724
p00063
C++
#include<iostream>int p(char*s){int l=strlen(s),i;for (i=l;i--;)if (s[i]!=s[l-i-1])return 0;return 1;}int c;int main(){char s[101];while (std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}
a.cc:1:23: warning: extra tokens at end of #include directive 1 | #include<iostream>int p(char*s){int l=strlen(s),i;for (i=l;i--;)if (s[i]!=s[l-i-1])return 0;return 1;}int c;int main(){char s[101];while (std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;} | ^ a.cc:1:9: fatal error: iostream>in: No such file or directory 1 | #include<iostream>int p(char*s){int l=strlen(s),i;for (i=l;i--;)if (s[i]!=s[l-i-1])return 0;return 1;}int c;int main(){char s[101];while (std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;} | ^~~~~~~~~~~~~ compilation terminated.
s808551348
p00063
C++
#include<iostream>int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}int c;int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}
a.cc:1:23: warning: extra tokens at end of #include directive 1 | #include<iostream>int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}int c;int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;} | ^ a.cc:1:9: fatal error: iostream>in: No such file or directory 1 | #include<iostream>int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;}int c;int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;} | ^~~~~~~~~~~~~ compilation terminated.
s368187380
p00063
C++
#include<iostream> int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;} int c; int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}
a.cc: In function 'int p(char*)': a.cc:2:21: error: 'strlen' was not declared in this scope 2 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;} | ^~~~~~ 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 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;} a.cc:2:37: error: 'i' was not declared in this scope 2 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;} | ^
s402921691
p00063
C++
#include<iostream> #include<stdio.h> int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;} int c; int main(){char s[101];while(std::cin>>s)p(s)?++c:c;std::cout<<c<<std::endl;}
a.cc: In function 'int p(char*)': a.cc:3:21: error: 'strlen' was not declared in this scope 3 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;} | ^~~~~~ 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<stdio.h> a.cc:3:37: error: 'i' was not declared in this scope 3 | int p(char*s){int l=strlen(s),i;for(i=l;i--;)return s[i]!=s[l-i-1]?0:1;} | ^
s529139607
p00063
C++
#include<iostream> #include<string> using namespace std; int c; int main(){ for (string s, t; getline(cin, s), t = s,reverse(t.begin(),t.end()),s=="\0";) c += (s == t); cout << c << endl; }
a.cc: In function 'int main()': a.cc:7:50: error: 'reverse' was not declared in this scope 7 | for (string s, t; getline(cin, s), t = s,reverse(t.begin(),t.end()),s=="\0";) | ^~~~~~~
s206793388
p00064
Java
#include <stdio.h> #include <string.h> int main(void) { char str[100][100]; int i, j, k, sum, mul; i = 0; sum = 0; while (scanf("%s" , str[i]) != EOF){ for (j = 0; j < strlen(str[i]); j++){ if (str[i][j] >= '0' && str[i][j] <= '9'){ mul = 1; for (k = 1; str[i][j+k] - '0' >= 0 && str[i][j+k] - '0' <= 9; k++){ mul *= 10; //printf("%d >%d\n", mul, j); } sum += (str[i][j] - '0') * mul; } } i++; } printf("%d\n", sum); return (0); }
Main.java:1: error: illegal character: '#' #include <stdio.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <stdio.h> ^ Main.java:2: error: illegal character: '#' #include <string.h> ^ Main.java:7: error: class, interface, enum, or record expected int i, j, k, sum, mul; ^ Main.java:9: error: class, interface, enum, or record expected i = 0; ^ Main.java:10: error: class, interface, enum, or record expected sum = 0; ^ Main.java:11: error: class, interface, enum, or record expected while (scanf("%s" , str[i]) != EOF){ ^ Main.java:12: error: class, interface, enum, or record expected for (j = 0; j < strlen(str[i]); j++){ ^ Main.java:12: error: class, interface, enum, or record expected for (j = 0; j < strlen(str[i]); j++){ ^ Main.java:15: error: class, interface, enum, or record expected for (k = 1; str[i][j+k] - '0' >= 0 && str[i][j+k] - '0' <= 9; k++){ ^ Main.java:15: error: class, interface, enum, or record expected for (k = 1; str[i][j+k] - '0' >= 0 && str[i][j+k] - '0' <= 9; k++){ ^ Main.java:15: error: class, interface, enum, or record expected for (k = 1; str[i][j+k] - '0' >= 0 && str[i][j+k] - '0' <= 9; k++){ ^ Main.java:18: error: class, interface, enum, or record expected } ^ Main.java:20: error: class, interface, enum, or record expected } ^ Main.java:23: error: class, interface, enum, or record expected } ^ Main.java:27: error: class, interface, enum, or record expected return (0); ^ Main.java:28: error: class, interface, enum, or record expected } ^ 17 errors
s505935324
p00064
Java
public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader reader = new BufferedReader(new InputStreamReader( System.in)); StringBuilder builder = new StringBuilder(); String line; int count = 0; while ((line = reader.readLine()) != null) { Pattern pattern = Pattern.compile("([0-9]+)"); Matcher matcher = pattern.matcher(line); while(matcher.find()){ count+= Integer.parseInt(matcher.group()); } } System.out.println(count); } }
Main.java:5: error: cannot find symbol IOException { ^ symbol: class IOException location: class Main Main.java:6: error: cannot find symbol BufferedReader reader = new BufferedReader(new InputStreamReader( ^ symbol: class BufferedReader location: class Main Main.java:6: error: cannot find symbol BufferedReader reader = new BufferedReader(new InputStreamReader( ^ symbol: class BufferedReader location: class Main Main.java:6: error: cannot find symbol BufferedReader reader = new BufferedReader(new InputStreamReader( ^ symbol: class InputStreamReader location: class Main Main.java:12: error: cannot find symbol Pattern pattern = Pattern.compile("([0-9]+)"); ^ symbol: class Pattern location: class Main Main.java:12: error: cannot find symbol Pattern pattern = Pattern.compile("([0-9]+)"); ^ symbol: variable Pattern location: class Main Main.java:13: error: cannot find symbol Matcher matcher = pattern.matcher(line); ^ symbol: class Matcher location: class Main 7 errors
s979654350
p00064
Java
import java.io.*; class Main{ public static void main(Sting[] args) throws IOException{ BufferedReader br=new BfferedReader(new InputStreamReader(System.in)); String line=""; int count=0; while((line=br.readLine())!=null){ int a=0; boolean f=false; for(int i=0;i<line.length();i++){ f=false; if(line.charAt(i)>='0'&&line.charAt(i)<='9'){ a=a*10+(int)(line.charAt(i)-'0'); f=true; } if(!f){ count+=a; a=0; } } } System.out.println(count); } }
Main.java:4: error: cannot find symbol public static void main(Sting[] args) throws IOException{ ^ symbol: class Sting location: class Main Main.java:5: error: cannot find symbol BufferedReader br=new BfferedReader(new InputStreamReader(System.in)); ^ symbol: class BfferedReader location: class Main 2 errors
s738528885
p00064
Java
package Vol000; import java.util.Scanner; public class AOJ0_64 { public static void main(String arg[]) { Scanner in = new Scanner(System.in); int count =0; String tmp = "0"; while(in.hasNext()) { char ch[]=in.nextLine().toCharArray(); for(int i=0; i<ch.length; i++) { while(i<ch.length&&(Character.isDigit(ch[i]))) { tmp+=ch[i]; i++; } count+=Integer.valueOf(tmp); tmp="0"; } } System.out.println(count); } }
Main.java:4: error: class AOJ0_64 is public, should be declared in a file named AOJ0_64.java public class AOJ0_64 ^ 1 error
s354313028
p00064
C
#include <stdio.h>int a, b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}
main.c:1:19: warning: extra tokens at end of #include directive 1 | #include <stdio.h>int a, b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;} | ^~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s674228838
p00064
C
int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;}
main.c: In function 'main': main.c:1:26: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;} main.c:1:26: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;} | ^~~~~ main.c:1:26: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:50: error: 'EOF' undeclared (first use in this function) 1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;} | ^~~ main.c:1:50: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:50: note: each undeclared identifier is reported only once for each function it appears in main.c:1:61: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | int a,b;int main(){while(scanf("%*[^0-9]%d",&a)!=EOF){b+=a;}printf("%d\n",b);a=0;} | ^~~~~~ main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:61: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf'
s867090056
p00064
C
#include<string.h> #include<ctype.h> #include<math.h> int main(void) { char str[81]; int count = 0,length,i,j=0,k=0; while (scanf("%s",str) != EOF) { length = strlen(str); for (i = length - 1; i >= 0; i--) { if (isdigit(str[i])) { j = 0; while (1) { if (isdigit(str[i - j])) { count += (str[i - j]-'0') * (pow(10, j)); k++; } else { i -= k; break; } j++; } } } } printf("%d\n",count); return 0; }
main.c: In function 'main': main.c:8:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 8 | while (scanf("%s",str) != EOF) | ^~~~~ main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 3 | #include<math.h> +++ |+#include <stdio.h> 4 | int main(void) { main.c:8:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 8 | while (scanf("%s",str) != EOF) | ^~~~~ main.c:8:16: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:8:35: error: 'EOF' undeclared (first use in this function) 8 | while (scanf("%s",str) != EOF) | ^~~ main.c:8:35: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:8:35: note: each undeclared identifier is reported only once for each function it appears in main.c:28:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 28 | printf("%d\n",count); | ^~~~~~ main.c:28:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:28:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:28:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s828756363
p00064
C
include<stdio.h> #include<string.h> #include<math.h> int main(){ int i,j,k; int n=0; char s[81]; while(scanf("%s",s)!=-1){ for(i=0;i<strlen(s);i++){ if('1'<=s[i]&&s[i]<='9'){ for(j=i+1;j<strlen(s);j++){ if(s[j]<'0'||'9'<s[j]) break; } for(k=0;k<j-i;k++) n+=(s[i+k]-'0')*pow(10,j-i-k-1); i=j; } } } printf("%d\n",n); return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 33 | #include <stddef.h> +++ |+#include <stddef.h> 34 | /usr/include/string.h:47:56: error: unknown type name 'size_t' 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:55:32: error: unknown type name 'size_t' 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:61:42: error: unknown type name 'size_t' 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:64:56: error: unknown type name 'size_t' 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:80:60: error: unknown type name 'size_t' 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:107:48: error: unknown type name 'size_t' 107 | extern void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:145:53: error: unknown type name 'size_t' 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:153:23: error: unknown type name 'size_t' 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:159:57: error: unknown type name 'size_t' 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:166:8: error: unknown type name 'size_t' 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:167:54: error: unknown type name 'size_t' 167 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:8: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:59: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:195:45: error: unknown type name 'size_t' 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:293:8: error: unknown type name 'size_t' 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:297:8: error: unknown type name 'size_t' 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:389:46: error: unknown type name 'size_t' 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:390:44: error: unknown type name 'size_t' 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:398:55: error: unknown type name 'size_t' 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:401:53: error: unknown type name 'size_t' 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:407:8: error: unknown type name 'size_t' 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:8: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:46: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26: /usr/include/string.h:432:12: error: unknown type name 'size_t' 432 | extern int __REDIRECT_NTH (strerror_r, | ^~~~~~~~~~~~~~ /usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: unknown type name 'size_t' 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 23 | #include <stddef.h> +++ |+#include <stddef.h> 24 | /usr/include/strings.h:38:53: error: unknown type name 'size_t' 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:42:31: error: unknown type name 'size_t' 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:120:61: error: unknown type name 'size_t' 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:134:27: error: unknown type name 'size_t' 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/strings.h:134:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:466:40: error: unknown type name
s105659133
p00064
C
#include<stdio.h> #include<string.h> int func(int); int t; char str[81]; int main(void){ int ans,i; memset(str,'a',sizeof(str)); ans=0; while(~scanf("%[^\n]%*c",str)){ for(i=0;i<strlen(str);i++) if(str[i]-'0'<10 && str[i]-'0'>=0){ ans+=func(i); printf("%d\n",res); i=t; } } printf("%d\n",ans); return 0; } int func(int a){ int x=0,i; for(i=a;str[i]-'0'<10;i++){ if(i!=a)x*=10; x+=str[i]-'0'; } t=i; return x; }
main.c: In function 'main': main.c:19:23: error: 'res' undeclared (first use in this function) 19 | printf("%d\n",res); | ^~~ main.c:19:23: note: each undeclared identifier is reported only once for each function it appears in
s202773705
p00064
C
/* */ #include <stdio.h> #include <string.h> #include <ctype.h> int mystrtol(char text[], char **pEnd, int value); int main(void){ char text[101]; int sum; int i, temp; char *pStart; char *pEnd; while(fgets(text, sizeof(text), stdin) != NULL){ i = 0; pStart = text; text[strlen(text)-1] = '\0'; while(pStart[i] != '\0'){ if(isdigit(pStart[i])){ temp = mystrtol(pStart+i, &pEnd, 10); //printf("temp = %d\n", temp); pStart = pEnd; i = 0; sum += temp; } else{ i++; } } } printf("%d\n", sum); return 0; } int mystrtol(char text[], char **pEnd, int value){ int value; int i = 0; char temp[32]; while(isdigit(text[i])){ temp[i] = text[i]; i++; } temp[i] = '\0'; *pEnd = &text[i]; return atoi(temp); }
main.c: In function 'mystrtol': main.c:64:13: error: 'value' redeclared as different kind of symbol 64 | int value; | ^~~~~ main.c:62:44: note: previous definition of 'value' with type 'int' 62 | int mystrtol(char text[], char **pEnd, int value){ | ~~~~^~~~~ main.c:81:16: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration] 81 | return atoi(temp); | ^~~~
s611572118
p00064
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define each(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define all(v) v.begin(), v.end() #define mset(a, n) memset(a, n, sizeof(a)) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<string> vs; typedef vector<vector<int> > vvi; typedef vector<pair<int, int> > vpii; typedef pair<int, int> pii; typedef pair<long long, long long> pll; const int inf = 1000000000; const int mod = 1000000007; const double eps = 1e-9; const int dx[] = { -1, 0, 1, 0}; const int dy[] = { 0, -1, 0, 1}; int main() { string s; int ans = 0; while (cin >> s) { s += ' ' string num; rep(i, s.size()) { if ('0' <= s[i] && s[i] <= '9') num += s[i]; else { ans += atoi(num.c_str()); num.clear(); } } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:31:25: error: expected ';' before 'string' 31 | s += ' ' | ^ | ; 32 | string num; | ~~~~~~ a.cc:34:57: error: 'num' was not declared in this scope; did you mean 'enum'? 34 | if ('0' <= s[i] && s[i] <= '9') num += s[i]; | ^~~ | enum a.cc:36:45: error: 'num' was not declared in this scope; did you mean 'enum'? 36 | ans += atoi(num.c_str()); | ^~~ | enum
s086366280
p00064
C++
a;main(n){for(;~scanf("%*[^0-9]%d",&n);)a+=n;a=!printf("%d\n",a);}
a.cc:1:1: error: 'a' does not name a type 1 | a;main(n){for(;~scanf("%*[^0-9]%d",&n);)a+=n;a=!printf("%d\n",a);} | ^ a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token 1 | a;main(n){for(;~scanf("%*[^0-9]%d",&n);)a+=n;a=!printf("%d\n",a);} | ^
s267347077
p00064
C++
#include <iostream> #include <cstdio> #include <vector> #include <list> #include <algorithm> #include <cmath> #include <stack> #include <map> #include <numeric> using namespace std; #define REP(i,n) for(int (i)=0; (i)<(n); (i)++) #define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++) #define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);} #define ALL(v) v.begin(), v.end() #define print(s) cout << (s) << endl int main() { string s = ""; int cnt = 0; char c; bool isint = false; bool minus = false; while((c = getchar() != EOF) { if (c >= '0' && c <= '9') { if (isint) { s += c; isint = true; }else if (!minus) { s = ""; s += c; isint = true; } }else if (isint) { cnt += stoi(s); s = ""; isint = false; if (c == '-') { minus = true; }else { minus = false; } }else { isint = false; if (c == '-') { minus = true; }else { minus = false; } } } if (s != "") { cnt += stoi(s); } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:24:33: error: expected ')' before '{' token 24 | while((c = getchar() != EOF) { | ~ ^~ | )