submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s676152058
p00216
C++
File Edit Options Buffers Tools C++ Help #include<iostream> #include<string> #include<cmath> #include<vector> #include<stack> #include<queue> #include<algorithm> #include<complex> using namespace std ; typedef vector<int> vi ; typedef vector<vi> vvi ; typedef vector<string> vs ; typedef pair<int, int> pii; typedef long long ll ; #define loop(i,a,b) for(int i = a ; i < b ; i ++) #define rep(i,a) loop(i,0,a) #define all(a) (a).begin(),(a).end() int main(void){ int n; while(cin>>n,n!=-1){ int sum = 0 ; if(n <= 10)sum = 1150 ; else if(n <= 20)sum += 1150 + (n-10) * 125; else if(n <= 30)sum += 1150 + 1250 + (n-20) * 140; else sum += 1150 + 1250 + 1400 + (n-30) * 160; cout<<4280-sum<<endl; } }
a.cc:1:1: error: 'File' does not name a type 1 | File Edit Options Buffers Tools C++ Help | ^~~~ 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:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
s596716598
p00216
C++
def water_charges(w): progressive_rate = { (float('inf'),30):160, (30,20):140, (20,10):125, (10, 0):0} charge = basic_charge = 1150 for (upper, lower), rate in progressive_rate.items(): usage = min(w, upper) - lower if 0 < usage: charge += usage * rate return charge import sys f = sys.stdin last_water_charges = 4280 while True: w = int(f.readline()) if w == -1: break print(last_water_charges - water_charges(w))
a.cc:3:12: warning: multi-character character constant [-Wmultichar] 3 | (float('inf'),30):160, | ^~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def water_charges(w): | ^~~ a.cc:8:5: error: 'charge' does not name a type; did you mean 'char'? 8 | charge = basic_charge = 1150 | ^~~~~~ | char
s200987772
p00216
C++
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; int w,sum; string str; int main(){ while(1){ cin>>>w; if(w==-1){break;} if(w<=10){cout<<4280-1150<<endl;} else if(w<=20){cout<<4280-(1150+(w-10)*125)<<endl;} else if(w<=30){cout<<4280-(1150+1250+(w-20)*140)<<endl;} else {cout<<4280-(1150+1250+1400+(w-30)*160)<<endl;} } return 0; }
a.cc: In function 'int main()': a.cc:12:22: error: expected primary-expression before '>' token 12 | cin>>>w; | ^
s680628843
p00216
C++
#include<iostream> using namespace std; int getCost(int w){ int cost = 1150; // ?¬¬????????? for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; // ?¬¬????????? else if ( 30 < i ) cost += 160; // ?¬¬????????? else cost += 140; // ?¬¬????????? } return cost;
a.cc: In function 'int getCost(int)': a.cc:10:14: error: expected '}' at end of input 10 | return cost; | ^ a.cc:3:19: note: to match this '{' 3 | int getCost(int w){ | ^
s409891443
p00216
C++
import java.util.Scanner; public class P01{ public P01(){ Scanner scan = new Scanner(System.in) for(int w; scan.hasNextInt() && w >= 0;){ System.out.println( 4280-getCost(w)); } } public int getCost(int w){ int cost = 1150; // ?¬¬????????? for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; // ?¬¬????????? else if ( 30 < i ) cost += 160; // ?¬¬????????? else cost += 140; // ?¬¬????????? } return cost; } public static void main(String[] args){ P01 p01 = new P01(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class P01{ | ^~~~~~
s703649262
p00216
C++
#include<iostream> using namespace std; int getCost(int w){ int cost = 1150; // ?¬¬????????? for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; // ?¬¬????????? else if ( 30 < i ) cost += 160; // ?¬¬????????? else cost += 140; // ?¬¬????????? } return cost;
a.cc: In function 'int getCost(int)': a.cc:10:14: error: expected '}' at end of input 10 | return cost; | ^ a.cc:3:19: note: to match this '{' 3 | int getCost(int w){ | ^
s394180124
p00216
C++
#include<iostream> using namespace std; int getCost(int w){ int cost = 1150; // ?¬¬????????? for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; // ?¬¬????????? else if ( 30 < i ) cost += 160; // ?¬¬????????? else cost += 140; // ?¬¬????????? } return cost;
a.cc: In function 'int getCost(int)': a.cc:10:14: error: expected '}' at end of input 10 | return cost; | ^ a.cc:3:19: note: to match this '{' 3 | int getCost(int w){ | ^
s677413004
p00216
C++
#include<iostream> using namespace std; int getCost(int w){ int cost = 1150; // ?¬¬????????? for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; // ?¬¬????????? else if ( 30 < i ) cost += 160; // ?¬¬????????? else cost += 140; // ?¬¬????????? } return cost;
a.cc: In function 'int getCost(int)': a.cc:10:14: error: expected '}' at end of input 10 | return cost; | ^ a.cc:3:19: note: to match this '{' 3 | int getCost(int w){ | ^
s332941718
p00216
C++
#include<iostream> using namespace std; int getCost(int w){ int cost = 1150; // ?¬¬????????? for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; // ?¬¬????????? else if ( 30 < i ) cost += 160; // ?¬¬????????? else cost += 140; // ?¬¬????????? } return cost;
a.cc: In function 'int getCost(int)': a.cc:10:14: error: expected '}' at end of input 10 | return cost; | ^ a.cc:3:19: note: to match this '{' 3 | int getCost(int w){ | ^
s357886137
p00216
C++
import java.util.Scanner; public class P01{ public P01(){ Scanner scan = new Scanner(System.in) for(int w; scan.hasNextInt() && w >= 0;){ System.out.println( 4280-getCost(w)); } } public int getCost(int w){ int cost = 1150; // ?¬¬????????? for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; // ?¬¬????????? else if ( 30 < i ) cost += 160; // ?¬¬????????? else cost += 140; // ?¬¬????????? } return cost; } public static void main(String[] args){ P01 p01 = new P01(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class P01{ | ^~~~~~
s621898635
p00216
C++
import java.util.Scanner; public class P01{ public P01(){ Scanner scan = new Scanner(System.in) for(int w; scan.hasNextInt() && w >= 0;){ System.out.println( 4280-getCost(w)); } } public int getCost(int w){ int cost = 1150; // ?¬¬????????? for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; // ?¬¬????????? else if ( 30 < i ) cost += 160; // ?¬¬????????? else cost += 140; // ?¬¬????????? } return cost; } public static void main(String[] args){ P01 p01 = new P01(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class P01{ | ^~~~~~
s967901379
p00216
C++
import java.util.Scanner; public class P01{ public P01(){ Scanner scan = new Scanner(System.in) for(int w; scan.hasNextInt() && w >= 0;){ System.out.println( 4280-getCost(w)); } } public int getCost(int w){ int cost = 1150; // ?¬¬????????? for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; // ?¬¬????????? else if ( 30 < i ) cost += 160; // ?¬¬????????? else cost += 140; // ?¬¬????????? } return cost; } public static void main(String[] args){ P01 p01 = new P01(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class P01{ | ^~~~~~
s481323639
p00216
C++
#include<stdio.h> int main(void) { int n,t,i,k,j,g,s; while(1) { scanf("%d",&t); if(t==-1) break; if(10>=t){ y=4280-1150; printf("%d\n",y); } if(t>10&&t<20){ n=t-10; i=4280-(n*125+1150); printf("%d\n",i); } if(t>20&&t<30){ k=t-20; j=4280-((k*140)+2400); printf("%d\n",j); } if(t>30){ s=t-30; g=4280-((s*160)+3800); printf("%d\n",g); } } return 0; }
a.cc: In function 'int main()': a.cc:9:25: error: 'y' was not declared in this scope 9 | y=4280-1150; | ^
s283929221
p00216
C++
#include<iostream> using namespace std; int getCost(int w){ int cost = 1150; for (int i = 11; i <= w; i++ ){ if ( i <= 20 ) cost += 125; else if ( 30 < i ) cost += 160; else cost += 140; } return cost;
a.cc: In function 'int getCost(int)': a.cc:10:13: error: expected '}' at end of input 10 | return cost; | ^ a.cc:3:19: note: to match this '{' 3 | int getCost(int w){ | ^
s976795019
p00216
C++
main(n){for(;scanf("%d",&n)+n;printf("%d\n",(n<11?626:n<21?886-n*25:n<31?936-n*28:1056-n*32)*5));}
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(n){for(;scanf("%d",&n)+n;printf("%d\n",(n<11?626:n<21?886-n*25:n<31?936-n*28:1056-n*32)*5));} | ^
s402002485
p00216
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include <queue> #include <cstring> using namespace std; static const double EPS = 1e-5; typedef long long ll; int kakaku(n){ int value=0; value+=1150; n-=10; if(n>0)value+=125*n; n-=10 if(n>0)value+=15*n; n-=10; if(n>0)value+=20*n; return value; } int main(){ int sui,sen,kon; cin>>sui; if(sui==-1)return ; sen=kakaku(sui); while(cin>>sui){ if(sui==-1)break; kon=kakaku(sui); cout<<kon-sen<<endl; sen=kon; } return 0; }
a.cc:25:12: error: 'n' was not declared in this scope; did you mean 'yn'? 25 | int kakaku(n){ | ^ | yn a.cc: In function 'int main()': a.cc:41:20: error: return-statement with no value, in function returning 'int' [-fpermissive] 41 | if(sui==-1)return ; | ^~~~~~ a.cc:42:19: error: 'kakaku' cannot be used as a function 42 | sen=kakaku(sui); | ~~~~~~^~~~~ a.cc:47:27: error: 'kakaku' cannot be used as a function 47 | kon=kakaku(sui); | ~~~~~~^~~~~
s203136366
p00216
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include <queue> #include <cstring> using namespace std; static const double EPS = 1e-5; typedef long long ll; int kakaku(int n){ int value=0; value+=1150; n-=10; if(n>0)value+=125*n; n-=10 if(n>0)value+=15*n; n-=10; if(n>0)value+=20*n; return value; } int main(){ int sui,sen,kon; cin>>sui; if(sui==-1)return ; sen=kakaku(sui); while(cin>>sui){ if(sui==-1)break; kon=kakaku(sui); cout<<kon-sen<<endl; sen=kon; } return 0; }
a.cc: In function 'int kakaku(int)': a.cc:30:14: error: expected ';' before 'if' 30 | n-=10 | ^ | ; 31 | if(n>0)value+=15*n; | ~~ a.cc: In function 'int main()': a.cc:41:20: error: return-statement with no value, in function returning 'int' [-fpermissive] 41 | if(sui==-1)return ; | ^~~~~~
s054292635
p00216
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include <queue> #include <cstring> using namespace std; static const double EPS = 1e-5; typedef long long ll; int kakaku(int n){ int value=0; value+=1150; n-=10; if(n>0)value+=125*n; n-=10; if(n>0)value+=15*n; n-=10; if(n>0)value+=20*n; return value; } int main(){ int sui,sen,kon; cin>>sui; if(sui==-1)return ; sen=kakaku(sui); while(cin>>sui){ if(sui==-1)break; kon=kakaku(sui); cout<<kon-sen<<endl; sen=kon; } return 0; }
a.cc: In function 'int main()': a.cc:41:20: error: return-statement with no value, in function returning 'int' [-fpermissive] 41 | if(sui==-1)return ; | ^~~~~~
s559135128
p00216
C++
clude <iostream> using namespace std; int main() { int n; while(cin >> n && (n >=0)) { int sum = 1150; if(n > 10 && n <= 20) sum += (n - 10) * 125; if(n > 20 && n <= 30) sum += 10 * 125 + (n - 20) * 140; if(n > 30) sum += 10 * 125 + 10 * 140 + (n - 30) * 160; cout << 4280 - sum << endl; } }
a.cc:1:1: error: 'clude' does not name a type 1 | clude <iostream> | ^~~~~ a.cc: In function 'int main()': a.cc:7:11: error: 'cin' was not declared in this scope 7 | while(cin >> n && (n >=0)) { | ^~~ a.cc:15:9: error: 'cout' was not declared in this scope 15 | cout << 4280 - sum << endl; | ^~~~ a.cc:15:31: error: 'endl' was not declared in this scope 15 | cout << 4280 - sum << endl; | ^~~~
s550554921
p00216
C++
main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;} | ^~~~ a.cc: In function 'int main()': a.cc:1:28: error: 'scanf' was not declared in this scope 1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;} | ^~~~~ a.cc:1:46: error: 'printf' was not declared in this scope 1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;} | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){int w,s;for(;s=1150,scanf("%d",&w),~w;printf("%d\n",4280-s))w<11?0:w<21?s+=w*125-1250:w<31?s+=140*w-1550:s+=w*160-2150;}
s868783049
p00216
C++
#include<iostream> using namespace std; int main(){ int n, bill; while(cin>>n,~n){ bill = 1150; n-=10; if(n<0)n=0; if(n>10){bill += 125*10; n -= 10;} else{bill += 125*n; n = 0;} if(n>10){bill += 140*10; n -= 10;} else{bill += 140*n; n = 0;} bill += 160*n; cout<<4280bill<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:7: error: unable to find numeric literal operator 'operator""bill' 17 | cout<<4280bill<<endl; | ^~~~~~~~
s427963386
p00216
C++
main(){ int w, p; while(scanf("%d", &w), w+1){ p = 3130; if(w > 30)p -= 2650 + (w-30) * 160; else if(w > 20)p -= 1250 + (w-20) * 140; else if(w > 10)p -= (w-10) * 125; printf("%d\n", p); } }
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:3:15: error: 'scanf' was not declared in this scope 3 | while(scanf("%d", &w), w+1){ | ^~~~~ a.cc:8:17: error: 'printf' was not declared in this scope 8 | printf("%d\n", p); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){
s117448686
p00216
C++
#include<iostream> #include<cstdio> using namespace std; int main(void) { while(1){ int rate; cin >> rate; if(rate == -1) break; else{ if(rate==0){ rate==0; } else{ rate-=10; } while(1){ if(rate >=0 && rate < 10){ rate*=125; break; }else if(rate >= 10 && rate < 20){ rate-=10; rate*=140; rate+=1250; break; }else if(rate >= 20 && rate < 30){ rate-=20; rate*=160; rate+=2650; break; }else if(rate >= 30){ rate = 4250; } rate+=1150; cout << 4280-rate << endl; } } }
a.cc: In function 'int main()': a.cc:39:2: error: expected '}' at end of input 39 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s775117649
p00217
Java
class Pair { int num; int walk; Pair(int num, int walk) { this.num = num; this.walk = walk; } } public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); while(stdIn.hasNext()) { int n = stdIn.nextInt(); if(n == 0) { break; } List<Pair> list = new ArrayList<Pair>(); for(int i = 0; i < n; ++i) { int num = stdIn.nextInt(); int day1 = stdIn.nextInt(); int day2 = stdIn.nextInt(); list.add(new Pair(num, day1 + day2)); } Collections.sort(list, new Comparator<Pair>() { public int compare(Pair t1, Pair t2) { return (t1.walk - t2.walk); } } ); System.out.println(list.get(list.size() - 1).num + " " + list.get(list.size() - 1).walk); } } }
Main.java:16: error: cannot find symbol Scanner stdIn = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:16: error: cannot find symbol Scanner stdIn = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:24: error: cannot find symbol List<Pair> list = new ArrayList<Pair>(); ^ symbol: class List location: class Main Main.java:24: error: cannot find symbol List<Pair> list = new ArrayList<Pair>(); ^ symbol: class ArrayList location: class Main Main.java:32: error: cannot find symbol Collections.sort(list, new Comparator<Pair>() ^ symbol: class Comparator location: class Main Main.java:32: error: cannot find symbol Collections.sort(list, new Comparator<Pair>() ^ symbol: variable Collections location: class Main 6 errors
s739368191
p00217
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int n,p,d1,d2,maxp,maxv; while(stdIn.hasNextInt()){ n = stdIn.nextInt(); if(n == 0) break; maxp = maxv = 0; for(int i = 0;i < n;i++){ p = stdIn.nextInt(); d1 = stdIn.nextInt(); d2 = stdIn.nextInt(); if(maxv < d1+d2){ maxp = p; maxv = d1 + d2; } } System.out.printf(maxp,maxv); } } }
Main.java:20: error: no suitable method found for printf(int,int) System.out.printf(maxp,maxv); ^ method PrintStream.printf(String,Object...) is not applicable (argument mismatch; int cannot be converted to String) method PrintStream.printf(Locale,String,Object...) is not applicable (argument mismatch; int cannot be converted to Locale) 1 error
s882798358
p00217
C
#include<stdio.h> int main(void){ int n,p,best,No,i,d1[1000],d2[1000]; scanf("%d %d %d %d",&n,&p,&d1[0],&d2[0]); best=d1[0]+d2[0]; No=p; for(i=1;i<n;i++){ scanf("%d %d %d",&p,&d1[i],&d2[i]); if(best<d1[i]+d2[i]){ best=d1[i]+d2[i]; No=p; } printf("%d %d\n",No,best); return 0; }
main.c: In function 'main': main.c:15:1: error: expected declaration or statement at end of input 15 | } | ^
s493757178
p00217
C
#include<stdio.h> int main(void){ int n,p,best,No,sum,i,d1[1000],d2[1000]; scanf("%d %d %d %d",&n,&p,&d1[0],&d2[0]); best=d1[0]+d2[0]; No=p; for(i=1;i<n;i++){ scanf("%d %d %d",&p,&d1[i],&d2[i]); sum=d1[i]+d2[i]; if(best<sum){ best=sum; No=p; } printf("%d %d\n",No,best); return 0; }
main.c: In function 'main': main.c:16:1: error: expected declaration or statement at end of input 16 | } | ^
s171654641
p00217
C
#include<stdio.h> int P[10001][2]={0}; void reset(int x[][]); int main(){ int n,max=0,save; int c,d1,d2; while(scanf("%d",&n)!=EOF){ if(n==0) {break;} for(c=0;c<n;c++){ scanf("%d %d %d",&P[c][0],&d1,&d2); P[c][1]=d1+d2; } for(c=0;c<n;c++){ if(P[c][1]>max){max=P[c][1];save=c;} } printf("%d %d\n",P[save][0],P[save][1]); int a,b; for(a=0;a<10001;a++){ for(b=0;b<2;b++){ P[a][b]=0; } } } return 0; }
main.c:5:16: error: array type has incomplete element type 'int[]' 5 | void reset(int x[][]); | ^ main.c:5:16: note: declaration of 'x' as multidimensional array must have bounds for all dimensions except the first
s470458126
p00217
C
m; main(n,p,d,e,b) { for(;;) { scanf("%d",&n); if(!n)exit(0); for(;n--;m=0) { scanf("%d%d%d",&p,&d,&e); if(m<d+e) m=d+e,b=p; } printf("%d %d\n",b,m); }
main.c:1:1: warning: data definition has no type or storage class 1 | m; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(n,p,d,e,b) | ^~~~ main.c: In function 'main': main.c:2:1: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:2:1: error: type of 'p' defaults to 'int' [-Wimplicit-int] main.c:2:1: error: type of 'd' defaults to 'int' [-Wimplicit-int] main.c:2:1: error: type of 'e' defaults to 'int' [-Wimplicit-int] main.c:2:1: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:6:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | scanf("%d",&n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | m; main.c:6:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | scanf("%d",&n); | ^~~~~ main.c:6:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:7:11: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 7 | if(!n)exit(0); | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | m; main.c:7:11: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 7 | if(!n)exit(0); | ^~~~ main.c:7:11: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:14:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 14 | printf("%d %d\n",b,m); | ^~~~~~ main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:14:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:15:3: error: expected declaration or statement at end of input 15 | } | ^
s473616688
p00217
C
#include<stdio.h> int main(void) { int n; int p,d1,d2,MAX=0; 1<=n && n<=10000; 1<=p && p<=10000; 0<=d1 && d1<=5000; 0<=d2 && d2<=5000; d=d1+d2; scanf("%d",&n); while(n!=0) { for(i=1;i<=n;i++) { printf("Dataを入力してください\n"); scanf("%d %d %d",&p,&d1,&d2); if((d1+d2) > MAX) { (d1+d2)=MAX; } } printf("%d %d %d\n",&p,&(d1+d2)); scanf("%d",&n); } return 0; }
main.c: In function 'main': main.c:10:9: error: 'd' undeclared (first use in this function); did you mean 'd2'? 10 | d=d1+d2; | ^ | d2 main.c:10:9: note: each undeclared identifier is reported only once for each function it appears in main.c:13:21: error: 'i' undeclared (first use in this function) 13 | for(i=1;i<=n;i++) { | ^ main.c:17:40: error: lvalue required as left operand of assignment 17 | (d1+d2)=MAX; | ^ main.c:20:40: error: lvalue required as unary '&' operand 20 | printf("%d %d %d\n",&p,&(d1+d2)); | ^
s475583426
p00217
C
#include<stdio.h> int main(void) { int n; int p,d1,d2,d,MAX=0; 1<=n && n<=10000; 1<=p && p<=10000; 0<=d1 && d1<=5000; 0<=d2 && d2<=5000; d=d1+d2; scanf("%d",&n); while(n!=0) { for(i=1;i<=n;i++) { printf("Dataを入力してください\n"); scanf("%d %d %d",&p,&d1,&d2); if((d1+d2) > MAX) { (d1+d2)=MAX; } } printf("%d %d %d\n",&p,&d); scanf("%d",&n); } return 0; }
main.c: In function 'main': main.c:13:21: error: 'i' undeclared (first use in this function) 13 | for(i=1;i<=n;i++) { | ^ main.c:13:21: note: each undeclared identifier is reported only once for each function it appears in main.c:17:40: error: lvalue required as left operand of assignment 17 | (d1+d2)=MAX; | ^
s830797613
p00217
C++
#include <algorithm> #include <functional> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <sstream> #include <iostream> #include <iomanip> #include <vector> #include <list> #include <stack> #include <queue> #include <map> #include <set> #include <bitset> #include <climits> #define all(c) (c).begin(), (c).end() #define rep(i,n) for(int i=0;i<(n);i++) #define pb(e) push_back(e) #define mp(a, b) make_pair(a, b) #define fr first #define sc second const int INF=100000000; int dx[4]={1,0,-1,0}; int dy[4]={0,1,0,-1}; using namespace std; typedef pair<int ,int > P; typedef long long ll; int N; map<int,int> data; void solve() { data.clear(); rep(i,N) { int a,b,c; cin>>a>>b>>c; data[b+c]=a; } auto it = data.end(); --it; cout<<it->sc<<" "<<it->fr<<endl; } int main() { while(cin>>N) { if(!N) break; solve(); } return 0; }
a.cc: In function 'void solve()': a.cc:37:5: error: reference to 'data' is ambiguous 37 | data.clear(); | ^~~~ In file included from /usr/include/c++/14/unordered_map:42, from /usr/include/c++/14/functional:63, from a.cc:2: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:34:14: note: 'std::map<int, int> data' 34 | map<int,int> data; | ^~~~ a.cc:41:9: error: reference to 'data' is ambiguous 41 | data[b+c]=a; | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:34:14: note: 'std::map<int, int> data' 34 | map<int,int> data; | ^~~~ a.cc:44:15: error: reference to 'data' is ambiguous 44 | auto it = data.end(); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:34:14: note: 'std::map<int, int> data' 34 | map<int,int> data; | ^~~~
s035223838
p00217
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> using namespace std; int main() { int n; while (cin >> n, n) { vector<pair<int,int> > v; int p, d1, d2; for (int i=0; i<n; ++i) { cin >> p >> d1 >> d2; v.push_back(make_pair(-d1-d2, p)); } sort(v.begin(), v.end()); cout << v[i].second << " " << -v[i].first << endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:19: error: 'i' was not declared in this scope 18 | cout << v[i].second << " " << -v[i].first << endl; | ^
s956601818
p00217
C++
#include<iostream> #include<algorithm> #include<functional> using namespace std; int main(){ int n; while(cin>>n,n){ int ans=0,most=-1,tmp,t1,t2; for(int i=0;i<n;i++){ cin>>tmp>>t1>>t2; if(most<t1+t2){ most=t1+t2; ans=tmp; } } cout<<ans<<" "<<most<<endl; } return INT_MIN; }
a.cc: In function 'int main()': a.cc:18:16: error: 'INT_MIN' was not declared in this scope 18 | return INT_MIN; | ^~~~~~~ a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include<functional> +++ |+#include <climits> 4 | using namespace std;
s475160243
p00217
C++
#include<stdio.h> int main(){ int x,y,z,N,p; int max=0.sum=0; while(1){ scanf("%d",&N);if(N==0)break; for(int i=0;i<N;i++){ scanf("%d %d %d",&p,&x,&y); if(max<x+y){max=x+y;sum=p;} } printf("%d %d\n",sum,max); } return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: unable to find numeric literal operator 'operator""sum' 6 | int max=0.sum=0; | ^~~~~ a.cc:12:21: error: 'sum' was not declared in this scope 12 | if(max<x+y){max=x+y;sum=p;} | ^~~ a.cc:14:18: error: 'sum' was not declared in this scope 14 | printf("%d %d\n",sum,max); | ^~~
s307478860
p00217
C++
#include<iostream> #include<vector> using namespace std; struct patient{ int p, d, dd; bool operator<(const patient &p)const{ return d + dd < p.d + p.dd; } bool operator>(const patient &p)const{ return d + dd > p.d + p.dd; } }; int main(int argc, char *argv[]){ int n; while(std::cin >> n, n){ vector<patient> vp; for (int i = 0; i < n; i++) { patient p; std::cin >> p.p >> p.d >> p.dd; vp.push_back(p); } sort(vp.begin(), vp.end(), greater<patient>()); std::cout << vp[0].p << " " << vp[0].d + vp[0].dd << std::endl; } return 0; }
a.cc: In function 'int main(int, char**)': a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'? 24 | sort(vp.begin(), vp.end(), greater<patient>()); | ^~~~ | short
s348175402
p00217
C++
#include "bits/stdc++.h" #include<unordered_map> #include<unordered_set> #pragma warning(disable:4996) using namespace std; using ld = long double; template<class T> using Table = vector<vector<T>>; const ld eps=1e-9; //// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" int main() { while (1) { int N; cin >> N; if (!N)break; int amax = -1; int id = 0; for (int i = 0; i < N; ++i) { int p, d1, d2; cin >> p >> d1 >> d2; if (amax < d1 + d2) { id = p; amax = d1 + d2; } } cout << id<< " "<<amx<< endl; } return 0; }
a.cc: In function 'int main()': a.cc:27:35: error: 'amx' was not declared in this scope; did you mean 'amax'? 27 | cout << id<< " "<<amx<< endl; | ^~~ | amax
s355859805
p00217
C++
#include<iostream> using namespace std; int main(){ //??????????????§????????°????????????????????????????????? = ???????????? while(true){ int n; cin >> n; if (n == 0) break; int max_p = 0, max_d = 0; for (int i = 0; i < n; i++) { int p, d1, d2; cin >>p >> d1 >> d2; if (max_d <= d1 + d2) { max_d = d1 + d2; max_p = p; } } cout << max_p << " " << max_d << endl; } return 0;
a.cc: In function 'int main()': a.cc:25:18: error: expected '}' at end of input 25 | return 0; | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s352355684
p00217
C++
#inclue<stdio.h> int main(void) { int n,max,i,p[10000],d1,d2,d[10000],x; while(1){ max=0; scanf("%d",&n); if(n==0)break; for(i=0;i<n;i++){ scanf("%d %d %d",&p[i],&d1,&d2); d[i]=d1+d2; } for(i=0;i<n;i++){ if(max<d[i]){ max=d[i]; x=p[i]; } } printf("%d %d\n",x,max); } return 0; }
a.cc:1:2: error: invalid preprocessing directive #inclue; did you mean #include? 1 | #inclue<stdio.h> | ^~~~~~ | include a.cc: In function 'int main()': a.cc:7:17: error: 'scanf' was not declared in this scope 7 | scanf("%d",&n); | ^~~~~ a.cc:19:17: error: 'printf' was not declared in this scope 19 | printf("%d %d\n",x,max); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | #inclue<stdio.h>
s075418017
p00217
C++
#include<iostream> using namespace std; int main(){ int n; while(cin>>n,n){ int maxi=-INF; int ans=0; for(int i=0; i<n;i++){ int a,b,c; cin>a>>b>>c; if(maxi<b+c){ maxi=b+c; ans=a} } cout<<ans<<" "<<maxi<<endl; } }
a.cc: In function 'int main()': a.cc:9:19: error: 'INF' was not declared in this scope 9 | int maxi=-INF; | ^~~ a.cc:12:23: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 12 | int a,b,c; cin>a>>b>>c; | ~~~^~~~~~~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:12:23: note: candidate: 'operator>(int, int)' (built-in) 12 | int a,b,c; cin>a>>b>>c; | ~~~^~~~~~~~ a.cc:12:23: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/string:48, 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_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 12 | int a,b,c; cin>a>>b>>c; | ^ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 12 | int a,b,c; cin>a>>b>>c; | ^ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 12 | int a,b,c; cin>a>>b>>c; | ^ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 12 | int a,b,c; cin>a>>b>>c; | ^ 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:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 12 | int a,b,c; cin>a>>b>>c; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 12 | int a,b,c; cin>a>>b>>c; | ^ /usr/include/c++/14/string_view:702: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> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 12 | int a,b,c; cin>a>>b>>c; | ^ /usr/include/c++/14/string_view:710: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>)' 710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed: a.cc:12:30: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 12 | int a,b,c; cin>a>>b>>c; | ^ /usr/include/c++/14/bits/basic_string.h:3915: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>&)' 3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | int a,b,c; cin>a>>b>>c; | ^ /usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | int a,b,c; cin>a>>b>>c; | ^ /usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3942 | operator>(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed: a.cc:12:30: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 12 | int a,b,c; cin>a>>b>>c; | ^ 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:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2619 | operator>(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed: a.cc:12:30: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>' 12 | int a,b,c; cin>a>>b>>c; | ^ a.cc:15:22: error: expected ';' before '}' token 15 | ans=a} | ^ | ;
s929368802
p00217
C++
#include <cstdio> #include <iostream> #include <string> using namespace std; class Point{ public: int n,walk; Point(int n = 0,int walk = 0):n(n),walk(walk){} bool operator < (const Point &s) const{ return walk > s.walk;} }; int main(){ int i,j,n; while(1){ Point p[10000]; cin >> n; if(n == 0) break; int a,b; for(i=0;i<n;i++){ cin >> p[i].n >> a >> b; p[i].walk = a + b; } sort(p,p+n); cout << p[0].n << " " << p[0].walk << endl; } return 0; }
a.cc: In function 'int main()': a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'? 24 | sort(p,p+n); | ^~~~ | short
s824204180
p00217
C++
#include<iostream> using namespace std; int main(){ int n,p,d1,d2,maxp,maaxv; while(1){ cin >> n if(n == 0) break; maxp = maxv = 0; while(n --){ cin >> p >> d1 >> d2; if(maxv < d1+d2){ maxp = p; maxv = d1+d2; } cout>> maxp >> maxv; } }
a.cc: In function 'int main()': a.cc:6:25: error: expected ';' before 'if' 6 | cin >> n | ^ | ; 7 | if(n == 0) break; | ~~ a.cc:8:24: error: 'maxv' was not declared in this scope; did you mean 'maaxv'? 8 | maxp = maxv = 0; | ^~~~ | maaxv a.cc:15:21: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 15 | cout>> maxp >> maxv; | ~~~~^~ ~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:15:21: note: candidate: 'operator>>(int, int)' (built-in) 15 | cout>> maxp >> maxv; | ~~~~^~~~~~~ a.cc:15:21: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:15:17: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 15 | cout>> maxp >> maxv; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:15:10: required from here 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s729557288
p00217
C++
#include<iostream> using namespace std; int main(){ int n,p,d1,d2,maxp,maxv; while(1){ cin >> n if(n == 0) break; maxp = maxv = 0; while(n --){ cin >> p >> d1 >> d2; if(maxv < d1+d2){ maxp = p; maxv = d1+d2; } cout>> maxp >> maxv; } }
a.cc: In function 'int main()': a.cc:6:25: error: expected ';' before 'if' 6 | cin >> n | ^ | ; 7 | if(n == 0) break; | ~~ a.cc:15:21: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 15 | cout>> maxp >> maxv; | ~~~~^~ ~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:15:21: note: candidate: 'operator>>(int, int)' (built-in) 15 | cout>> maxp >> maxv; | ~~~~^~~~~~~ a.cc:15:21: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:15:17: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 15 | cout>> maxp >> maxv; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:15:24: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:15:10: required from here 15 | cout>> maxp >> maxv; | ^~~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s381532854
p00217
C++
#include<iostream> using namespace std; int main(){ int n,p,d1,d2,maxp,maxv; while(1){ cin >> n if(n == 0) break; maxp = maxv = 0; while(n --){ cin >> p >> d1 >> d2; if(maxv < d1+d2){ maxp = p; maxv = d1+d2; } cout<< maxp << maxv; } }
a.cc: In function 'int main()': a.cc:6:25: error: expected ';' before 'if' 6 | cin >> n | ^ | ; 7 | if(n == 0) break; | ~~ a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s457270939
p00217
C++
#include<iostream> using namespace std; int main(){ int n,p,d1,d2,maxp,maxv; while(1){ cin >> n if(n == 0) break; maxp = maxv = 0; while(n --){ cin >> p >> d1 >> d2; if(maxv < d1+d2){ maxp = p; maxv = d1+d2; } } cout<< maxp << maxv; } }
a.cc: In function 'int main()': a.cc:6:25: error: expected ';' before 'if' 6 | cin >> n | ^ | ; 7 | if(n == 0) break; | ~~
s218799668
p00217
C++
using namespace std; int main(){ int n,p,d1,d2,maxp,maxv; while(1){ cin >> n; if(n == 0) break; maxp = maxv = 0; while(n --){ cin >> p >> d1 >> d2; if(maxv < d1+d2){ maxp = p; maxv = d1+d2; } } cout<< maxp << maxv; } }
a.cc: In function 'int main()': a.cc:6:17: error: 'cin' was not declared in this scope 6 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:16:17: error: 'cout' was not declared in this scope 16 | cout<< maxp << maxv; | ^~~~ a.cc:16:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s242272947
p00217
C++
#include<iostream> using namespace std; int main(){ int n,p,d1,d2,maxp,maxv; while(1){ cin >> n; if(n == 0) break; maxp = maxv = -1; while(n --){ cin >> p >> d1 >> d2; if(maxv < d1+d2){ maxp = p; maxv = d1+d2; } } cout<< maxp << << maxv; } }
a.cc: In function 'int main()': a.cc:16:32: error: expected primary-expression before '<<' token 16 | cout<< maxp << << maxv; | ^~
s669310666
p00218
Java
import java.util.Scanner; public class main { Scanner sc = new Scanner(System.in); int pm,pe,pj; double avg1,avg2; int nin; public void sei(){ nin = sc.nextInt(); while(!(nin==0)){ for(int i = 1;i<=nin;i++){ pm = sc.nextInt(); pe = sc.nextInt(); pj = sc.nextInt(); if((pm==100)||(pe==100)||(pj==100)){ System.out.println("A"); }else{ avg1 = (pm +pe) / 2; if(avg1>=90){ System.out.println("A"); }else{ avg2 = (pm + pe + pj) / 3; if(avg2>=80){ System.out.println("A"); }else{ if(avg2>=70){ System.out.println("B"); }else{ if(avg2>=50){ if((pm>=80)||(pe>=80)){ System.out.println("B"); }else{ System.out.println("C"); } }else{ System.out.println("C"); } } } } } } nin = sc.nextInt(); } } /** * @param args */ public static void main(String[] args) { main a = new main(); a.sei(); // TODO 自動生成されたメソッド・スタブ } }
Main.java:3: error: class main is public, should be declared in a file named main.java public class main { ^ 1 error
s770414066
p00218
Java
package aizu; import java.util.Scanner; public class ao { Scanner sc = new Scanner(System.in); int pm,pe,pj; double avg1,avg2; int nin; public void sei(){ nin = sc.nextInt(); while(!(nin==0)){ for(int i = 1;i<=nin;i++){ pm = sc.nextInt(); pe = sc.nextInt(); pj = sc.nextInt(); if((pm==100)||(pe==100)||(pj==100)){ System.out.println("A"); }else{ avg1 = (pm +pe) / 2; if(avg1>=90){ System.out.println("A"); }else{ avg2 = (pm + pe + pj) / 3; if(avg2>=80){ System.out.println("A"); }else{ if(avg2>=70){ System.out.println("B"); }else{ if(avg2>=50){ if((pm>=80)||(pe>=80)){ System.out.println("B"); }else{ System.out.println("C"); } }else{ System.out.println("C"); } } } } } } nin = sc.nextInt(); } } /** * @param args */ public static void main(String[] args) { ao a = new ao(); a.sei(); // TODO 自動生成されたメソッド・スタブ } }
Main.java:3: error: class ao is public, should be declared in a file named ao.java public class ao { ^ 1 error
s582807279
p00218
Java
package aizu; import java.util.Scanner; public static void main(String[] args) { public class ao { Scanner sc = new Scanner(System.in); int pm,pe,pj; double avg1,avg2; int nin; public void sei(){ nin = sc.nextInt(); while(!(nin==0)){ for(int i = 1;i<=nin;i++){ pm = sc.nextInt(); pe = sc.nextInt(); pj = sc.nextInt(); if((pm==100)||(pe==100)||(pj==100)){ System.out.println("A"); }else{ avg1 = (pm +pe) / 2; if(avg1>=90){ System.out.println("A"); }else{ avg2 = (pm + pe + pj) / 3; if(avg2>=80){ System.out.println("A"); }else{ if(avg2>=70){ System.out.println("B"); }else{ if(avg2>=50){ if((pm>=80)||(pe>=80)){ System.out.println("B"); }else{ System.out.println("C"); } }else{ System.out.println("C"); } } } } } } nin = sc.nextInt(); } } }
Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) Main.java:4: error: illegal start of expression public class ao { ^ Main.java:1: error: unnamed class should not have package declaration package aizu; ^ 3 errors
s752065994
p00218
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int n,pm,pe,pj; while(stdIn.hasNextInt()){ n = stdIn.nextInt(); for(int i = 0;i < n;i++){ pm = stdIn.nextInt(); pe = stdIn.nextInt(); pj = stdIn.nextInt(); if(pm == 100 || pe == 100 || pj == 100){ System.out.println("A"); }else if((pm + pe) / 2 >= 90){ System.out.println("A"); }else if((pm + pe + pj) / 3 >= 80){ System.out.println("A"); }else if((pm + pe + pj) / 3 >= 70){ System.out.println("B"); }else if((pm + pe + pj) / 3 >= 50 && (pm >= 80 || pe >= 80)){ System.out.println("B"); }else System.out.println("C"); } } }
Main.java:25: error: reached end of file while parsing } ^ 1 error
s183999931
p00218
C
#include<iostream> using namespace std; int main(){ int a,a1,a2,a3,i,sum=0,avg=0; while(1){ cin>>a; if(a==0) break; for(i=0;i<a;i++){ cin>>a1>>a2>>a3; sum=a1+a2+a3; avg=sum/3; if(a1==100||a2==100||a3==100||avg>=80||(a1+a2)/2>=90||avg>=50&&a1>=80&&a2>=80||avg>=70&&a1>=80||avg>=70&&a2>=80) cout<<'A'<<endl; else if(avg>=70||avg>=50&&a1>=80||avg>=50&&a2>=80) cout<<'B'<<endl; else cout<<'C'<<endl; } } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s570145670
p00218
C
#include <stdio.h> int sum[7]; int main(void) { int i, j, n; int m, e, j; float ave; while (scanf("%d", &n), n != 0){ for (j = 0; j < n; j++){ scanf("%d %d %d", &m, &e, &j); ave = (m + e + j) / 3.0; if (m == 100 || e == 100 || j == 100){ printf("A\n"); } else if ((m + e) / 2.0 >= 90){ printf("A\n"); else if (ave >= 80){ printf("A\n"); } else if (ave >= 70){ printf("B\n"); } else if (ave >= 50 && (m >= 80||e = 80)){ printf("B\n"); } else { printf("C\n"); } } } return 0; }
main.c: In function 'main': main.c:7:19: error: redeclaration of 'j' with no linkage 7 | int m, e, j; | ^ main.c:6:16: note: previous declaration of 'j' with type 'int' 6 | int i, j, n; | ^ main.c:20:25: error: expected '}' before 'else' 20 | else if (ave >= 80){ | ^~~~ main.c:26:59: error: lvalue required as left operand of assignment 26 | else if (ave >= 50 && (m >= 80||e = 80)){ | ^
s917180346
p00218
C
#include <stdio.h> int sum[7]; int main(void) { int i, _j, n; int m, e, j; float ave; while (scanf("%d", &n), n != 0){ for (_j = 0; _j < n; _j++){ scanf("%d %d %d", &m, &e, &j); ave = (m + e + j) / 3.0; if (m == 100 || e == 100 || j == 100){ printf("A\n"); } else if ((m + e) / 2.0 >= 90){ printf("A\n"); } else if (ave >= 80){ printf("A\n"); } else if (ave >= 70){ printf("B\n"); } else if (ave >= 50 && (m >= 80||e = 80)){ printf("B\n"); } else { printf("C\n"); } } } return 0; }
main.c: In function 'main': main.c:27:59: error: lvalue required as left operand of assignment 27 | else if (ave >= 50 && (m >= 80||e = 80)){ | ^
s010937821
p00218
C
#include<stdio.h> int main(void){ int n; int i; int mat,eng,jpn; while(scanf("%d",&n)){ if(n == 0){ break; } for(i = 0;i < n;i++){ scanf("%d %d %d",&mat,&eng,&jpn); if(mat == 100 || eng == 100 || jpn == 100 || (mat + eng) / 2 >= 90 || (eng + mat + jpn) / 3 >= 80){ printf("A\n"); } else if((mat + rng + jpn) / 3 >= 70 || ((mat + eng + jpn) / 3 >= 50 && (mat >= 80 || eng >= 80))){ printf("B\n"); } else{ printf("C\n"); } } } return 0; }
main.c: In function 'main': main.c:15:40: error: 'rng' undeclared (first use in this function); did you mean 'eng'? 15 | else if((mat + rng + jpn) / 3 >= 70 || ((mat + eng + jpn) / 3 >= 50 && (mat >= 80 || eng >= 80))){ | ^~~ | eng main.c:15:40: note: each undeclared identifier is reported only once for each function it appears in
s705357398
p00218
C
#include<stdio.h> int main() { int ; scanf("%d",&n); while(n!=0){ for(i=0;i<n;i++){ scanf("%d %d %d",&pm,&pe,&pj); if(pm==100||pj==100||pe==100||(pe+pm)/2>=90||(pe+pm+pj)/3>=80){ printf("A\n"); } else if((pe+pm+pj)/3>=70) printf("B\n"); else if((pe+pm+pj)/3>=50){ if(pm>=80||pe>=80){ printf("B\n"); } } else printf("C\n"); } scanf("%d",&n); } return 0; }
main.c: In function 'main': main.c:4:9: warning: useless type name in empty declaration 4 | int ; | ^~~ main.c:5:21: error: 'n' undeclared (first use in this function) 5 | scanf("%d",&n); | ^ main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in main.c:7:21: error: 'i' undeclared (first use in this function) 7 | for(i=0;i<n;i++){ | ^ main.c:8:43: error: 'pm' undeclared (first use in this function) 8 | scanf("%d %d %d",&pm,&pe,&pj); | ^~ main.c:8:47: error: 'pe' undeclared (first use in this function) 8 | scanf("%d %d %d",&pm,&pe,&pj); | ^~ main.c:8:51: error: 'pj' undeclared (first use in this function) 8 | scanf("%d %d %d",&pm,&pe,&pj); | ^~
s403426191
p00218
C
#include<stdio.h> int main(void) { int i,a,b[10001],c[10001],d[10001]; while(1){ scanf("%d",&a); if(a==0) break; for(i=0;i<a;i++){ scanf("%d %d %d",&b[i],&c[i],&d[i]); } for(i=0;i<a;i++){ if(b==100||c==100||d==100){ printf("A\n"); } else if((b+c)/2>=90){ printf("A\n"); } else if((b+c+d)/3>=80){ printf("A\n"); } else if((b+c+d)/3>=70){ printf("B\n"); } else if((b+c+d)/3>=50){ if(b>=80||c>=80){ printf("B\n"); } } else{ printf("C\n"); } } } return 0; }
main.c: In function 'main': main.c:12:13: warning: comparison between pointer and integer 12 | if(b==100||c==100||d==100){ | ^~ main.c:12:21: warning: comparison between pointer and integer 12 | if(b==100||c==100||d==100){ | ^~ main.c:12:29: warning: comparison between pointer and integer 12 | if(b==100||c==100||d==100){ | ^~ main.c:15:19: error: invalid operands to binary + (have 'int *' and 'int *') 15 | else if((b+c)/2>=90){ | ~^ | || | |int * | int * main.c:18:19: error: invalid operands to binary + (have 'int *' and 'int *') 18 | else if((b+c+d)/3>=80){ | ~^ | || | |int * | int * main.c:21:19: error: invalid operands to binary + (have 'int *' and 'int *') 21 | else if((b+c+d)/3>=70){ | ~^ | || | |int * | int * main.c:24:19: error: invalid operands to binary + (have 'int *' and 'int *') 24 | else if((b+c+d)/3>=50){ | ~^ | || | |int * | int * main.c:25:13: warning: comparison between pointer and integer 25 | if(b>=80||c>=80){ | ^~ main.c:25:20: warning: comparison between pointer and integer 25 | if(b>=80||c>=80){ | ^~
s153869547
p00218
C
#include<stdio.h> int main(void) { int n, i, pm, pe, pj,b[10000]; char a[3]; while (1) { scanf_s("%d", &n); if (n == 0)break; for (i = 0;i < n;i++) { scanf_s("%d %d %d", &pm, &pe, &pj); if (pm == 100 || pe == 100 || pj == 100) { printf("A\n"); } else if ((pm + pe) / 2 >= 90) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 80) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 70) { printf("B\n"); } else if ((pm + pe + pj) / 3 >= 50) { if (pm >= 80 || pe >= 80) { printf("B\n"); } else { printf("C\n"); } } else { printf("C\n"); } } } }
main.c: In function 'main': main.c:9:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 9 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s411688409
p00218
C
#include<stdio.h> int main(void) { int n, i, pm, pe, pj; while (1) { scanf_s("%d", &n); if (n == 0)break; for (i = 0;i < n;i++) { scanf("%d %d %d", &pm, &pe, &pj); if (pm == 100 || pe == 100 || pj == 100) { printf("A\n"); } else if ((pm + pe) / 2 >= 90) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 80) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 70) { printf("B\n"); } else if ((pm + pe + pj) / 3 >= 50) { if (pm >= 80 || pe >= 80) { printf("B\n"); } else { printf("C\n"); } } else { printf("C\n"); } } } }
main.c: In function 'main': main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 8 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s944253573
p00218
C
#include<stdio.h> int main(void) { int n, i, pm, pe, pj; while (1) { scanf_s("%d", &n); if (n == 0)break; for (i = 0;i < n;i++) { scanf("%d %d %d", &pm, &pe, &pj); if (pm == 100 || pe == 100 || pj == 100) { printf("A\n"); } else if ((pm + pe) / 2 >= 90) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 80) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 70) { printf("B\n"); } else if ((pm + pe + pj) / 3 >= 50) { if (pm >= 80 || pe >= 80) { printf("B\n"); } else { printf("C\n"); } } else { printf("C\n"); } } } }
main.c: In function 'main': main.c:8:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 8 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s086593541
p00218
C
#include<stdio.h> int main(void) { int n, i, pm, pe, pj; while (1) { scanf_s("%d", &n); if (n == 0)break; for (i = 0;i < n;i++) { scanf_s("%d %d %d", &pm, &pe, &pj); if (pm == 100 || pe == 100 || pj == 100) { printf("A\n"); } else if ((pm + pe) / 2 >= 90) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 80) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 70) { printf("B\n"); } else if ((pm + pe + pj) / 3 >= 50) { if (pm >= 80 || pe >= 80) { printf("B\n"); } else { printf("C\n"); } } else { printf("C\n"); } } } return 0; }
main.c: In function 'main': main.c:9:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 9 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s384927813
p00218
C
#include<stdio.h> int main(void) { int n=0, pm, pe, pj,i=0; while (1) { scanf_s("%d", &n); if (n == 0) break; for (i = 0;i < n;i++) { scanf_s("%d %d %d", &pm, &pe, &pj); if (pm == 100 || pe == 100 || pj == 100) { printf("A\n"); } else if ((pm + pe) / 2 >= 90) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 80) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 50 && (pm>=80 || pe>=80)) { printf("B\n"); } else if ((pm + pe + pj) / 3 >= 70) { printf("B\n"); } else { printf("C\n"); } } } return 0; }
main.c: In function 'main': main.c:5:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 5 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s095046818
p00218
C
#include<stdio.h> int main(void) { int n=0, pm, pe, pj,i=0; while (1) { scanf_s("%d", &n); if (n == 0) break; for (i = 0;i < n;i++) { scanf_s("%d %d %d", &pm, &pe, &pj); if (pm == 100 || pe == 100 || pj == 100) { printf("A\n"); } else if ((pm + pe) / 2 >= 90) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 80) { printf("A\n"); } else if ((pm + pe + pj) / 3 >= 50 && (pm>=80 || pe>=80)) { printf("B\n"); } else if ((pm + pe + pj) / 3 >= 70) { printf("B\n"); } else { printf("C\n"); } } } return 0; }
main.c: In function 'main': main.c:5:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 5 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s355033283
p00218
C
#include<stdio.h> int main(void){ int n,pm,pe,pj,i; while(1){ scanf("%d",&n); if(n==0) break; for(i=0;i<n;i++){ scanf("%d %d %d",&pm,&pe,&pj); if(pm==100 || pe==100 || pj==100){ printf("A\n"); }else if(((pm+pe)/2)>=90){ printf("A\n"); }else if(((pm+pe+pj)/3)>=80){ printf("A\n"); }else if(((pm+pe+pj)/3)>=70){ printf("B\n"); }else if(((pm+pe+pj)/3)>=50 && pm>=80 ||pe>=80){ printf("B\n"); }else{ printf("C\n"); } } } return 0;
main.c: In function 'main': main.c:24:9: error: expected declaration or statement at end of input 24 | return 0; | ^~~~~~
s921669815
p00218
C
#include<stdio.h> int main(void){ int n,pm,pe,pj,i; while(1){ scanf("%d",&n); if(n==0) break; for(i=0;i<n;i++){ scanf("%d %d %d",&pm,&pe,&pj); if(pm==100 || pe==100 || pj==100){ printf("A\n"); }else if(((pm+pe)/2)>=90){ printf("A\n"); }else if(((pm+pe+pj)/3)>=80){ printf("A\n"); }else if(((pm+pe+pj)/3)>=70){ printf("B\n"); }else if(((pm+pe+pj)/3)>=50 && pm>=80 ||pe>=80){ printf("B\n"); }else{ printf("C\n"); } } } return 0;
main.c: In function 'main': main.c:24:9: error: expected declaration or statement at end of input 24 | return 0; | ^~~~~~
s930183483
p00218
C
#include<stdio.h> int main(void){ int n,pm,pe,pj,i; while(1){ scanf("%d",&n); if(n==0) break; for(i=0;i<n;i++){ scanf("%d %d %d",&pm,&pe,&pj); if(pm==100 || pe==100 || pj==100){ printf("A\n"); }else if(((pm+pe)/2)>=90){ printf("A\n"); }else if(((pm+pe+pj)/3)>=80){ printf("A\n"); }else if(((pm+pe+pj)/3)>=70){ printf("B\n"); }else if(((pm+pe+pj)/3)>=50 && pm>=80 || pe>=80){ printf("B\n"); }else{ printf("C\n"); } } } return 0;
main.c: In function 'main': main.c:24:9: error: expected declaration or statement at end of input 24 | return 0; | ^~~~~~
s479564204
p00218
C
#include<string.h> #define P(type,x) fprintf(stdout,"%"#type"\n",x) int main() { int n; int m, e, j; while (~fscanf(stdin, "%d", &n), n != 0){ while (n--) { fscanf(stdin, "%d%d%d", &m, &e, &j); if (m == 100 || e == 100 || j == 100 || (m + e) / 2 >= 90.0 || (m + e + j) / 3 >= 80.0) puts("A"); else if ((m + e + j) / 3 >= 70.0 || (((m + e + j) / 3 >= 50.0) && (m >= 80 || e >= 80))) puts("B"); else puts("C"); } } return 0; }
main.c: In function 'main': main.c:6:17: error: implicit declaration of function 'fscanf' [-Wimplicit-function-declaration] 6 | while (~fscanf(stdin, "%d", &n), n != 0){ | ^~~~~~ main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'fscanf' 1 | #include<string.h> +++ |+#include <stdio.h> 2 | #define P(type,x) fprintf(stdout,"%"#type"\n",x) main.c:6:17: warning: incompatible implicit declaration of built-in function 'fscanf' [-Wbuiltin-declaration-mismatch] 6 | while (~fscanf(stdin, "%d", &n), n != 0){ | ^~~~~~ main.c:6:17: note: include '<stdio.h>' or provide a declaration of 'fscanf' main.c:6:24: error: 'stdin' undeclared (first use in this function) 6 | while (~fscanf(stdin, "%d", &n), n != 0){ | ^~~~~ main.c:6:24: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:6:24: note: each undeclared identifier is reported only once for each function it appears in main.c:9:113: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 9 | if (m == 100 || e == 100 || j == 100 || (m + e) / 2 >= 90.0 || (m + e + j) / 3 >= 80.0) puts("A"); | ^~~~ main.c:9:113: note: include '<stdio.h>' or provide a declaration of 'puts'
s075174725
p00218
C
#include <stdio.h> int main() { int i, n, pm, pe, pj; float a2, a3; scanf("%d", &n); for (i=1; i<=n; i++) { scanf("%d %d %d", &pm, &pe, &pj); a2 = (pm + pe)/2; a3 = (pm + pe + pj)/3; if (pm==100 || pe==100 || pj==100 || a2>=90 || a3>=80) printf("A\n"); else if (a3>=70 || (a3>=50 && (pm>=80 || pe>=80)) printf("B\n"); else printf("C\n"); } return 0; }
main.c: In function 'main': main.c:17:64: error: expected ')' before 'printf' 17 | else if (a3>=70 || (a3>=50 && (pm>=80 || pe>=80)) printf("B\n"); | ~ ^~~~~~~~~~~ | ) main.c:19:9: error: expected expression before '}' token 19 | } | ^
s778549449
p00218
C
#include <stdio.h> int main() { int i, n, pm, pe, pj; float a2, a3; scanf("%d", &n); for (i=1; i<=n; i++) { scanf("%d %d %d", &pm, &pe, &pj); a2 = (pm + pe)/2; a3 = (pm + pe + pj)/3; if (pm==100 || pe==100 || pj==100 || a2>=90 || a3>=80) printf("A\n"); else if (a3>=70 || (a3>=50 && (pm>=80 || pe>=80)) printf("B\n"); else printf("C\n"); } return 0; }
main.c: In function 'main': main.c:17:64: error: expected ')' before 'printf' 17 | else if (a3>=70 || (a3>=50 && (pm>=80 || pe>=80)) printf("B\n"); | ~ ^~~~~~~~~~~ | ) main.c:19:9: error: expected expression before '}' token 19 | } | ^
s571613988
p00218
C++
#include<stdio.h> void dividing_student(int a, int b, int c); void finish(); int main(void) { int n;/*nはデータの個数*/ scanf("%d", &n); for( int i = 0; i <= n; ++i){ if (i < n){ int pm ,pe, pj; /*左から数学、英語、国語の点数*/ scanf("%d %d %d", &pm, &pe, &pj); dividing_student( pm, pe, pj); }else{ finish(); } }/*return 0 いるの?*/ } void dividing_student( int a, int b, int c) { if( a >= 100|| b >= 100 || c >=100){ printf("A\n"); }else if( (a + b) / 2 >= 90){ printf("A\n"); }else if( (a + b + c) / 3 >= 80){ printf("A\n"); }else if( (a + b + c) / 3 >= 70){ printf("B\n"); }else if((a + b + c) / 3 >= 50 && (a >= 50 || b >= 50)){ printf("B\n"); }else{ printf("C\n"); } } void finish() { int n; scanf("%d", &n); if( n == 0){ return 0; }else{ for( int i = 0; i <= n; ++i){ if (i < n){ int pm ,pe, pj; /*左から数学、英語、国語の点数*/ scanf("%d %d %d", &pm, &pe, &pj); dividing_student( pm, pe, pj); }else{ finish(); } } } }
a.cc: In function 'void finish()': a.cc:44:16: error: return-statement with a value, in function returning 'void' [-fpermissive] 44 | return 0; | ^
s760374545
p00218
C++
#include <stdio.h> void judge(int pm, int pe, int pj); int main(void) { int dataset; int pm, pe, pj; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &pm, &pe, &pj); judge(pm, pe, pj); } } } return 0; } void judge(int pm, int pe, int pj) { int sum = pm + pe + pj; char class; if (pm == 100 || pe == 100 || pj == 100){ class = 'A'; } else if (pm + pe >= 180){ class = 'A'; } else if (sum >= 160){ class = 'A'; } else if (sum >= 140){ class = 'B'; } else if (sum >= 100 && (pm >= 80 || pe >= 80)){ class = 'B'; } else { class = 'C'; } printf("%c\n", class); }
a.cc: In function 'void judge(int, int, int)': a.cc:28:5: error: multiple types in one declaration 28 | char class; | ^~~~ a.cc:28:10: error: declaration does not declare anything [-fpermissive] 28 | char class; | ^~~~~ a.cc:28:5: error: expected primary-expression before 'char' 28 | char class; | ^~~~ a.cc:31:9: error: expected primary-expression before 'class' 31 | class = 'A'; | ^~~~~ a.cc:33:9: error: expected primary-expression before 'class' 33 | class = 'A'; | ^~~~~ a.cc:35:9: error: expected primary-expression before 'class' 35 | class = 'A'; | ^~~~~ a.cc:37:9: error: expected primary-expression before 'class' 37 | class = 'B'; | ^~~~~ a.cc:39:9: error: expected primary-expression before 'class' 39 | class = 'B'; | ^~~~~ a.cc:41:9: error: expected primary-expression before 'class' 41 | class = 'C'; | ^~~~~ a.cc:44:20: error: expected primary-expression before 'class' 44 | printf("%c\n", class); | ^~~~~
s867555466
p00218
C++
#include <stdio.h> void judge(int pm, int pe, int pj); int main(void) { int dataset; int pm, pe, pj; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &pm, &pe, &pj); judge(pm, pe, pj); } } } return 0; } void judge(int pm, int pe, int pj) { int sum = pm + pe + pj; char class; if (pm == 100 || pe == 100 || pj == 100){ class = 'A'; } else if (pm + pe >= 180){ class = 'A'; } else if (sum >= 240){ class = 'A'; } else if (sum >= 210){ class = 'B'; } else if (sum >= 150 && (pm >= 80 || pe >= 80)){ class = 'B'; } else { class = 'C'; } printf("%c\n", class); }
a.cc: In function 'void judge(int, int, int)': a.cc:28:5: error: multiple types in one declaration 28 | char class; | ^~~~ a.cc:28:10: error: declaration does not declare anything [-fpermissive] 28 | char class; | ^~~~~ a.cc:28:5: error: expected primary-expression before 'char' 28 | char class; | ^~~~ a.cc:31:9: error: expected primary-expression before 'class' 31 | class = 'A'; | ^~~~~ a.cc:33:9: error: expected primary-expression before 'class' 33 | class = 'A'; | ^~~~~ a.cc:35:9: error: expected primary-expression before 'class' 35 | class = 'A'; | ^~~~~ a.cc:37:9: error: expected primary-expression before 'class' 37 | class = 'B'; | ^~~~~ a.cc:39:9: error: expected primary-expression before 'class' 39 | class = 'B'; | ^~~~~ a.cc:41:9: error: expected primary-expression before 'class' 41 | class = 'C'; | ^~~~~ a.cc:44:20: error: expected primary-expression before 'class' 44 | printf("%c\n", class); | ^~~~~
s897152338
p00218
C++
#include <stdio.h> void judge(int pm, int pe, int pj); int main(void) { int dataset; int pm, pe, pj; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &pm, &pe, &pj); judge(pm, pe, pj); } } } return 0; } void judge(int pm, int pe, int pj) { int sum; sum = pm + pe + pj; char class; if (pm == 100 || pe == 100 || pj == 100){ class = 'A'; } else if (pm + pe >= 180){ class = 'A'; } else if (sum >= 240){ class = 'A'; } else if (sum >= 210){ class = 'B'; } else if (sum >= 150 && (pm >= 80 || pe >= 80)){ class = 'B'; } else { class = 'C'; } printf("%c\n", class); }
a.cc: In function 'void judge(int, int, int)': a.cc:29:5: error: multiple types in one declaration 29 | char class; | ^~~~ a.cc:29:10: error: declaration does not declare anything [-fpermissive] 29 | char class; | ^~~~~ a.cc:29:5: error: expected primary-expression before 'char' 29 | char class; | ^~~~ a.cc:32:9: error: expected primary-expression before 'class' 32 | class = 'A'; | ^~~~~ a.cc:34:9: error: expected primary-expression before 'class' 34 | class = 'A'; | ^~~~~ a.cc:36:9: error: expected primary-expression before 'class' 36 | class = 'A'; | ^~~~~ a.cc:38:9: error: expected primary-expression before 'class' 38 | class = 'B'; | ^~~~~ a.cc:40:9: error: expected primary-expression before 'class' 40 | class = 'B'; | ^~~~~ a.cc:42:9: error: expected primary-expression before 'class' 42 | class = 'C'; | ^~~~~ a.cc:45:20: error: expected primary-expression before 'class' 45 | printf("%c\n", class); | ^~~~~
s260928732
p00218
C++
#include <stdio.h> void judge(int pm, int pe, int pj); int main(void) { int dataset; int pm, pe, pj; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &pm, &pe, &pj); judge(pm, pe, pj); } } } return 0; } void judge(int pm, int pe, int pj) { char class; if (pm == 100 || pe == 100 || pj == 100){ class = 'A'; } else if (pm + pe >= 180){ class = 'A'; } else if (pm + pe + pj >= 240){ class = 'A'; } else if (pm + pe + pj >= 210){ class = 'B'; } else if (pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)){ class = 'B'; } else { class = 'C'; } printf("%c\n", class); }
a.cc: In function 'void judge(int, int, int)': a.cc:27:5: error: multiple types in one declaration 27 | char class; | ^~~~ a.cc:27:10: error: declaration does not declare anything [-fpermissive] 27 | char class; | ^~~~~ a.cc:27:5: error: expected primary-expression before 'char' 27 | char class; | ^~~~ a.cc:30:9: error: expected primary-expression before 'class' 30 | class = 'A'; | ^~~~~ a.cc:32:9: error: expected primary-expression before 'class' 32 | class = 'A'; | ^~~~~ a.cc:34:9: error: expected primary-expression before 'class' 34 | class = 'A'; | ^~~~~ a.cc:36:9: error: expected primary-expression before 'class' 36 | class = 'B'; | ^~~~~ a.cc:38:9: error: expected primary-expression before 'class' 38 | class = 'B'; | ^~~~~ a.cc:40:9: error: expected primary-expression before 'class' 40 | class = 'C'; | ^~~~~ a.cc:43:20: error: expected primary-expression before 'class' 43 | printf("%c\n", class); | ^~~~~
s996455128
p00218
C++
#include <stdio.h> void judge(int pm, int pe, int pj) { int sum = pm + pe + pj; char class; if (pm == 100 || pe == 100 || pj == 100){ class = 'A'; } else if (pm + pe >= 180){ class = 'A'; } else if (sum >= 240){ class = 'A'; } else if (sum >= 210){ class = 'B'; } else if (sum >= 150 && (pm >= 80 || pe >= 80)){ class = 'B'; } else { class = 'C'; } printf("%c\n", class); } int main(void) { int dataset; int pm, pe, pj; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &pm, &pe, &pj); judge(pm, pe, pj); } } } return 0; }
a.cc: In function 'void judge(int, int, int)': a.cc:6:5: error: multiple types in one declaration 6 | char class; | ^~~~ a.cc:6:10: error: declaration does not declare anything [-fpermissive] 6 | char class; | ^~~~~ a.cc:6:5: error: expected primary-expression before 'char' 6 | char class; | ^~~~ a.cc:9:9: error: expected primary-expression before 'class' 9 | class = 'A'; | ^~~~~ a.cc:11:9: error: expected primary-expression before 'class' 11 | class = 'A'; | ^~~~~ a.cc:13:9: error: expected primary-expression before 'class' 13 | class = 'A'; | ^~~~~ a.cc:15:9: error: expected primary-expression before 'class' 15 | class = 'B'; | ^~~~~ a.cc:17:9: error: expected primary-expression before 'class' 17 | class = 'B'; | ^~~~~ a.cc:19:9: error: expected primary-expression before 'class' 19 | class = 'C'; | ^~~~~ a.cc:22:20: error: expected primary-expression before 'class' 22 | printf("%c\n", class); | ^~~~~
s062934217
p00218
C++
#include <stdio.h> void judge(int pm, int pe, int pj) { char class; if (pm == 100 || pe == 100 || pj == 100){ class = 'A'; } else if (pm + pe >= 180){ class = 'A'; } else if (pm + pe + pj >= 240){ class = 'A'; } else if (pm + pe + pj >= 210){ class = 'B'; } else if (pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)){ class = 'B'; } else { class = 'C'; } printf("%c\n", class); } int main(void) { int dataset; int pm, pe, pj; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &pm, &pe, &pj); judge(pm, pe, pj); } } } return 0; }
a.cc: In function 'void judge(int, int, int)': a.cc:5:5: error: multiple types in one declaration 5 | char class; | ^~~~ a.cc:5:10: error: declaration does not declare anything [-fpermissive] 5 | char class; | ^~~~~ a.cc:5:5: error: expected primary-expression before 'char' 5 | char class; | ^~~~ a.cc:8:9: error: expected primary-expression before 'class' 8 | class = 'A'; | ^~~~~ a.cc:10:9: error: expected primary-expression before 'class' 10 | class = 'A'; | ^~~~~ a.cc:12:9: error: expected primary-expression before 'class' 12 | class = 'A'; | ^~~~~ a.cc:14:9: error: expected primary-expression before 'class' 14 | class = 'B'; | ^~~~~ a.cc:16:9: error: expected primary-expression before 'class' 16 | class = 'B'; | ^~~~~ a.cc:18:9: error: expected primary-expression before 'class' 18 | class = 'C'; | ^~~~~ a.cc:21:20: error: expected primary-expression before 'class' 21 | printf("%c\n", class); | ^~~~~
s653680203
p00218
C++
#include <stdio.h> void judge(int pm, int pe, int pj) { char class; if(pm == 100 || pe == 100 || pj == 100){ class='A'; }else if(pm + pe >= 180){ class='A'; }else if(pm + pe + pj >= 240){ class='A'; }else if(pm + pe + pj >= 210){ class='B'; }else if(pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)){ class='B'; }else{ class='C'; } printf("%c\n", class); } int main(void) { int dataset; int pm, pe, pj; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &pm, &pe, &pj); judge(pm, pe, pj); } } } return 0; }
a.cc: In function 'void judge(int, int, int)': a.cc:4:5: error: multiple types in one declaration 4 | char class; | ^~~~ a.cc:4:10: error: declaration does not declare anything [-fpermissive] 4 | char class; | ^~~~~ a.cc:4:5: error: expected primary-expression before 'char' 4 | char class; | ^~~~ a.cc:6:9: error: expected primary-expression before 'class' 6 | class='A'; | ^~~~~ a.cc:8:9: error: expected primary-expression before 'class' 8 | class='A'; | ^~~~~ a.cc:10:9: error: expected primary-expression before 'class' 10 | class='A'; | ^~~~~ a.cc:12:9: error: expected primary-expression before 'class' 12 | class='B'; | ^~~~~ a.cc:14:9: error: expected primary-expression before 'class' 14 | class='B'; | ^~~~~ a.cc:16:9: error: expected primary-expression before 'class' 16 | class='C'; | ^~~~~ a.cc:18:20: error: expected primary-expression before 'class' 18 | printf("%c\n", class); | ^~~~~
s126685106
p00218
C++
#include <stdio.h> void judge(int pm, int pe, int pj); int main(void) { int dataset; int pm, pe, pj; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &pm, &pe, &pj); judge(pm, pe, pj); } } } return 0; } void judge(int pm, int pe, int pj) { int sum = pm + pe + pj; char class; if (pm == 100 || pe == 100 || pj == 100){ class = 'A'; } else if (pm + pe >= 90 * 2){ class = 'A'; } else if (sum >= 80 * 3){ class = 'A'; } else if (sum >= 70 * 3){ class = 'B'; } else if (sum >= 50 * 3 && (pm >= 80 || pe >= 80)){ class = 'B'; } else { class = 'C'; } printf("%c\n", class); }
a.cc: In function 'void judge(int, int, int)': a.cc:28:5: error: multiple types in one declaration 28 | char class; | ^~~~ a.cc:28:10: error: declaration does not declare anything [-fpermissive] 28 | char class; | ^~~~~ a.cc:28:5: error: expected primary-expression before 'char' 28 | char class; | ^~~~ a.cc:31:9: error: expected primary-expression before 'class' 31 | class = 'A'; | ^~~~~ a.cc:33:9: error: expected primary-expression before 'class' 33 | class = 'A'; | ^~~~~ a.cc:35:9: error: expected primary-expression before 'class' 35 | class = 'A'; | ^~~~~ a.cc:37:9: error: expected primary-expression before 'class' 37 | class = 'B'; | ^~~~~ a.cc:39:9: error: expected primary-expression before 'class' 39 | class = 'B'; | ^~~~~ a.cc:41:9: error: expected primary-expression before 'class' 41 | class = 'C'; | ^~~~~ a.cc:44:20: error: expected primary-expression before 'class' 44 | printf("%c\n", class); | ^~~~~
s021080730
p00218
C++
#include <stdio.h> char divide(int math, int english, int japanese); char class; int main(void) { int dataset; int math, english, japanese; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &math, &english, &japanese); class = divide(math, english, japanese); printf("%c\n", class); } } } return 0; } char divide(int math, int english, int japanese) { int sum = math + english + japanese; if (math == 100 || english == 100 || japanese == 100){ class = 'A'; } else if (math + english >= 90 * 2){ class = 'A'; } else if (sum >= 80 * 3){ class = 'A'; } else if (sum >= 70 * 3){ class = 'B'; } else if (sum >= 50 * 3 && (math >= 80 || english >= 80)){ class = 'B'; } else { class = 'C'; } return class; }
a.cc:4:11: error: expected identifier before ';' token 4 | char class; | ^ a.cc:4:1: error: multiple types in one declaration 4 | char class; | ^~~~ a.cc:4:11: error: declaration does not declare anything [-fpermissive] 4 | char class; | ^ a.cc: In function 'int main()': a.cc:18:17: error: expected primary-expression before 'class' 18 | class = divide(math, english, japanese); | ^~~~~ a.cc:19:32: error: expected primary-expression before 'class' 19 | printf("%c\n", class); | ^~~~~ a.cc: In function 'char divide(int, int, int)': a.cc:32:9: error: expected primary-expression before 'class' 32 | class = 'A'; | ^~~~~ a.cc:34:9: error: expected primary-expression before 'class' 34 | class = 'A'; | ^~~~~ a.cc:36:9: error: expected primary-expression before 'class' 36 | class = 'A'; | ^~~~~ a.cc:38:9: error: expected primary-expression before 'class' 38 | class = 'B'; | ^~~~~ a.cc:40:9: error: expected primary-expression before 'class' 40 | class = 'B'; | ^~~~~ a.cc:42:9: error: expected primary-expression before 'class' 42 | class = 'C'; | ^~~~~ a.cc:45:12: error: expected primary-expression before 'class' 45 | return class; | ^~~~~ a.cc:45:11: error: expected ';' before 'class' 45 | return class; | ^~~~~~ | ; a.cc:45:12: error: expected primary-expression before 'class' 45 | return class; | ^~~~~
s903225821
p00218
C++
#include <stdio.h> char divide(int math, int english, int japanese); char class; int main(void) { int dataset; int math, english, japanese; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &math, &english, &japanese); class = divide(math, english, japanese); printf("%c\n", class); } } } return 0; } char divide(int math, int english, int japanese) { int sum = math + english + japanese; if (math == 100 || english == 100 || japanese == 100){ class = 'A'; } else if (math + english >= 90 * 2){ class = 'A'; } else if (sum >= 80 * 3){ class = 'A'; } else if (sum >= 70 * 3){ class = 'B'; } else if (sum >= 50 * 3 && (math >= 80 || english >= 80)){ class = 'B'; } else { class = 'C'; } return class; }
a.cc:4:11: error: expected identifier before ';' token 4 | char class; | ^ a.cc:4:1: error: multiple types in one declaration 4 | char class; | ^~~~ a.cc:4:11: error: declaration does not declare anything [-fpermissive] 4 | char class; | ^ a.cc: In function 'int main()': a.cc:18:17: error: expected primary-expression before 'class' 18 | class = divide(math, english, japanese); | ^~~~~ a.cc:19:32: error: expected primary-expression before 'class' 19 | printf("%c\n", class); | ^~~~~ a.cc: In function 'char divide(int, int, int)': a.cc:32:9: error: expected primary-expression before 'class' 32 | class = 'A'; | ^~~~~ a.cc:34:9: error: expected primary-expression before 'class' 34 | class = 'A'; | ^~~~~ a.cc:36:9: error: expected primary-expression before 'class' 36 | class = 'A'; | ^~~~~ a.cc:38:9: error: expected primary-expression before 'class' 38 | class = 'B'; | ^~~~~ a.cc:40:9: error: expected primary-expression before 'class' 40 | class = 'B'; | ^~~~~ a.cc:42:9: error: expected primary-expression before 'class' 42 | class = 'C'; | ^~~~~ a.cc:45:12: error: expected primary-expression before 'class' 45 | return class; | ^~~~~ a.cc:45:11: error: expected ';' before 'class' 45 | return class; | ^~~~~~ | ; a.cc:45:12: error: expected primary-expression before 'class' 45 | return class; | ^~~~~
s351896227
p00218
C++
#include <stdio.h> char divide(int math, int english, int japanese); char class; int main(void) { int dataset; int math, english, japanese; while (1){ scanf("%d", &dataset); if (dataset == 0){ break; } else { while (dataset--){ scanf("%d %d %d", &math, &english, &japanese); class = divide(math, english, japanese); printf("%c\n", class); } } } return 0; } char divide(int math, int english, int japanese) { int sum = math + english + japanese; if (math == 100 || english == 100 || japanese == 100){ class = 'A'; } else if (math + english >= 90 * 2){ class = 'A'; } else if (sum >= 80 * 3){ class = 'A'; } else if (sum >= 70 * 3){ class = 'B'; } else if (sum >= 50 * 3 && (math >= 80 || english >= 80)){ class = 'B'; } else { class = 'C'; } return class; }
a.cc:4:11: error: expected identifier before ';' token 4 | char class; | ^ a.cc:4:1: error: multiple types in one declaration 4 | char class; | ^~~~ a.cc:4:11: error: declaration does not declare anything [-fpermissive] 4 | char class; | ^ a.cc: In function 'int main()': a.cc:18:17: error: expected primary-expression before 'class' 18 | class = divide(math, english, japanese); | ^~~~~ a.cc:19:32: error: expected primary-expression before 'class' 19 | printf("%c\n", class); | ^~~~~ a.cc: In function 'char divide(int, int, int)': a.cc:32:9: error: expected primary-expression before 'class' 32 | class = 'A'; | ^~~~~ a.cc:34:9: error: expected primary-expression before 'class' 34 | class = 'A'; | ^~~~~ a.cc:36:9: error: expected primary-expression before 'class' 36 | class = 'A'; | ^~~~~ a.cc:38:9: error: expected primary-expression before 'class' 38 | class = 'B'; | ^~~~~ a.cc:40:9: error: expected primary-expression before 'class' 40 | class = 'B'; | ^~~~~ a.cc:42:9: error: expected primary-expression before 'class' 42 | class = 'C'; | ^~~~~ a.cc:45:12: error: expected primary-expression before 'class' 45 | return class; | ^~~~~ a.cc:45:11: error: expected ';' before 'class' 45 | return class; | ^~~~~~ | ; a.cc:45:12: error: expected primary-expression before 'class' 45 | return class; | ^~~~~
s648186673
p00218
C++
#include<stdio.h> void dividing(int pm, int pe, int pj); int main(void) { int n, pm, pe, pj; int i; while (1) { scanf("%d", &n); if (n == 0) { break; } else { while (i < n) { scanf("%d %d %d", &pm, &pe, &pj); dividing(pm, pe, pj); i++; } } } return 0; } void dividing(int pm, int pe, int pj) { if (pm == 100 || pe == 100 || pj == 100) { printf("A\n"); } else if ((pm + pe) / 2 > 90){ printf("A\n"); } else if ((pm + pe + pj) / 3 >80){ printf("A\n"); } else if ((pm + pe + pj) / 3 > 70){ printf("B\n"); } else if((pm + pe + pj) / 3 > 50 && (pm > 80 || pe > 80)){ printf("B\n"); } else { printf("C\n"); }
a.cc: In function 'void dividing(int, int, int)': a.cc:42:4: error: expected '}' at end of input 42 | } | ^ a.cc:25:1: note: to match this '{' 25 | { | ^
s651737502
p00218
C++
#include <stdio.h> int classjudge(int pm,int pe,int pj){ int class; if(pm == 100 || pe== 100 || pj== 100)class=0; else if(pm + pe >= 180)class=0; else if(pm + pe + pj >= 240)class=0; else if(pm + pe + pj >= 210)class=1; else if((pm + pe + pj >= 150) && (pm >= 80 || pe >= 80))class=1; else class=2; return class; } int main(void){ int n,pm,pe,pj; while(scanf("%d",&n) != EOF && n != 0){ for(int i=0;i < n;i++){ scanf("%d %d %d",&pm,&pe,&pj); printf("%c\n",'A' + classjudge(pm,pe,pj)); } } return 0; }
a.cc: In function 'int classjudge(int, int, int)': a.cc:4:5: error: multiple types in one declaration 4 | int class; | ^~~ a.cc:4:9: error: declaration does not declare anything [-fpermissive] 4 | int class; | ^~~~~ a.cc:4:5: error: expected primary-expression before 'int' 4 | int class; | ^~~ a.cc:5:42: error: expected primary-expression before 'class' 5 | if(pm == 100 || pe== 100 || pj== 100)class=0; | ^~~~~ a.cc:6:28: error: expected primary-expression before 'class' 6 | else if(pm + pe >= 180)class=0; | ^~~~~ a.cc:7:33: error: expected primary-expression before 'class' 7 | else if(pm + pe + pj >= 240)class=0; | ^~~~~ a.cc:8:33: error: expected primary-expression before 'class' 8 | else if(pm + pe + pj >= 210)class=1; | ^~~~~ a.cc:9:61: error: expected primary-expression before 'class' 9 | else if((pm + pe + pj >= 150) && (pm >= 80 || pe >= 80))class=1; | ^~~~~ a.cc:10:10: error: expected primary-expression before 'class' 10 | else class=2; | ^~~~~ a.cc:11:12: error: expected primary-expression before 'class' 11 | return class; | ^~~~~ a.cc:11:11: error: expected ';' before 'class' 11 | return class; | ^~~~~~ | ; a.cc:11:12: error: expected primary-expression before 'class' 11 | return class; | ^~~~~
s923904567
p00218
C++
#include <stdio.h> int classjudge(int pm,int pe,int pj){ int class; if(pm == 100 || pe== 100 || pj== 100){ class=0; } else if(pm + pe >= 180){ class=0; } else if(pm + pe + pj >= 240){ class=0; } else if(pm + pe + pj >= 210){ class=1; } else if((pm + pe + pj >= 150) && (pm >= 80 || pe >= 80)){ class=1; } else class=2; return class; } int main(void){ int n,pm,pe,pj; while(scanf("%d",&n) != EOF && n != 0){ for(int i=0;i < n;i++){ scanf("%d %d %d",&pm,&pe,&pj); printf("%c\n",'A' + classjudge(pm,pe,pj)); } } return 0; }
a.cc: In function 'int classjudge(int, int, int)': a.cc:4:5: error: multiple types in one declaration 4 | int class; | ^~~ a.cc:4:9: error: declaration does not declare anything [-fpermissive] 4 | int class; | ^~~~~ a.cc:4:5: error: expected primary-expression before 'int' 4 | int class; | ^~~ a.cc:6:9: error: expected primary-expression before 'class' 6 | class=0; | ^~~~~ a.cc:9:9: error: expected primary-expression before 'class' 9 | class=0; | ^~~~~ a.cc:12:9: error: expected primary-expression before 'class' 12 | class=0; | ^~~~~ a.cc:15:9: error: expected primary-expression before 'class' 15 | class=1; | ^~~~~ a.cc:18:9: error: expected primary-expression before 'class' 18 | class=1; | ^~~~~ a.cc:20:10: error: expected primary-expression before 'class' 20 | else class=2; | ^~~~~ a.cc:21:12: error: expected primary-expression before 'class' 21 | return class; | ^~~~~ a.cc:21:11: error: expected ';' before 'class' 21 | return class; | ^~~~~~ | ; a.cc:21:12: error: expected primary-expression before 'class' 21 | return class; | ^~~~~
s797075409
p00218
C++
#include <stdio.h> #include <stdbool.h> char dividing(int pm, int pe, int pj); int main(void) { int ninnzuu; int pm[1000], pe[1000], pj[1000]; char class[1000]; while(true) { scanf("%d", &ninnzuu); if(ninnzuu == 0) { break; } for(int i = 0; i < ninnzuu; i++) { scanf("%d %d %d", &pm[i], &pe[i], &pj[i]); class[i] = dividing(pm[i], pe[i], pj[i]); } for(int i = 0; i < ninnzuu; i++) { printf("%c\n", class[i]); } } return 0; } char dividing(int pm, int pe, int pj) { if(pm == 100 || pe == 100 || pj == 100) { return 'A'; }else if(pm + pe >= 180) { return 'A'; }else if(pm + pe + pj >= 240) { return 'A'; }else if(pm + pe + pj >= 210) { return 'B'; }else if(pm + pe + pj >= 150 && (pm >= 80 || pe >= 80)) { return 'B'; }else{ return 'C'; } }
a.cc: In function 'int main()': a.cc:10:9: error: two or more data types in declaration of 'structured binding' 10 | char class[1000]; | ^~~~ a.cc:10:19: error: empty structured binding declaration 10 | char class[1000]; | ^ a.cc:10:9: error: expected primary-expression before 'char' 10 | char class[1000]; | ^~~~ a.cc:18:30: error: structured binding declaration cannot have type 'int' 18 | class[i] = dividing(pm[i], pe[i], pj[i]); | ^~~ a.cc:18:30: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:18:31: error: redeclaration of 'auto i' 18 | class[i] = dividing(pm[i], pe[i], pj[i]); | ^ a.cc:16:25: note: 'int i' previously declared here 16 | for(int i = 0; i < ninnzuu; i++) { | ^ a.cc:18:48: error: use of 'i' before deduction of 'auto' 18 | class[i] = dividing(pm[i], pe[i], pj[i]); | ^ a.cc:18:55: error: use of 'i' before deduction of 'auto' 18 | class[i] = dividing(pm[i], pe[i], pj[i]); | ^ a.cc:18:62: error: use of 'i' before deduction of 'auto' 18 | class[i] = dividing(pm[i], pe[i], pj[i]); | ^ a.cc:18:25: error: expected primary-expression before 'class' 18 | class[i] = dividing(pm[i], pe[i], pj[i]); | ^~~~~ a.cc:21:40: error: expected primary-expression before 'class' 21 | printf("%c\n", class[i]); | ^~~~~
s572212843
p00218
C++
#include <stdio.h> #include <stdbool.h> int grading(int x, int y, int z, char rank) { int sum2 = x + y; int sum3 = x + y + z; if(x == 100 || y == 100 || z == 100){ rank = 'A'; }else if(sum2 >= 180){ rank = 'A'; }else if(sum3 >= 240){ rank = 'A'; }else if(sum3 >= 210){ rank = 'B'; }else if(sum3 >= 150 && (x >= 80 || y >= 80)){ rank = 'B'; }else{ rank = 'C'; } } int main(void) { int rep, ma, en, ja; char rank; while(true){ scanf("%d", &rep); if(n == 0){ break; } for(int i = 0; i < rep; ++i){ scanf ("%d%d%d", &ma, &en, &ja); grading(ma, en, ja,rank); printf("%c\n", rank); } } return 0; }
a.cc: In function 'int grading(int, int, int, char)': a.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type] 21 | } | ^ a.cc: In function 'int main()': a.cc:30:12: error: 'n' was not declared in this scope; did you mean 'en'? 30 | if(n == 0){ | ^ | en
s891105060
p00218
C++
#include <stdio.h> float mean2(int x, int y) { return (float)(x + y) / 2.0; } float mean3(int x, int y, int z) { return (floag)(x + y + z) / 3.0; } char grading(int p_math, int p_eng, int p_jpn) { if ( p_math == 100 || p_eng == 100 || p_jpn == 100) { return 'A'; } else if (mean2(p_math, p_jpn) >= 90.0) { return 'A'; } else if (mean3(p_math, p_eng, p_jpn) >= 80.0) { return 'A'; } else if (mean3(p_math, p_eng, p_jpn) >= 70.0) { return 'B' } else if (mean3(p_math, p_eng, p_jpn) >= 70.0 && (p_math >= 80 || p_eng >= 80)) { return 'B'; } else { return 'C'; } } int main(void) { int i, p_math, p_eng, p_jpn, n_iteration; char grade; scanf("%d", &n_iteration); for (i = 0; i < n_iteration; i++) { scanf("%d %d %d", &p_math, &p_eng, &p_jpn); grade = grading(p_math, p_eng, p_jpn); printf("%c\n", grade); } return 0; }
a.cc: In function 'float mean3(int, int, int)': a.cc:10:13: error: 'floag' was not declared in this scope; did you mean 'float'? 10 | return (floag)(x + y + z) / 3.0; | ^~~~~ | float a.cc: In function 'char grading(int, int, int)': a.cc:22:19: error: expected ';' before '}' token 22 | return 'B' | ^ | ; 23 | } else if (mean3(p_math, p_eng, p_jpn) >= 70.0 && (p_math >= 80 || p_eng >= 80)) { | ~
s415612373
p00218
C++
#include <stdio.h> int class(int pm, int pe, int pj); int main(void) { int n, pm, pe, pj; scanf("%d", &n); for (int i = 0;i < n;i ++){ scanf("%d %d %d", &pm, &pe, &pj); if (class(pm, pe, pj) == 1){ printf("A\n"); } else if (class(pm, pe, pj) == 2){ printf("B\n"); } else { printf("C\n"); } } return 0; } int class(int pm, int pe, int pj) { int ave = (pm + pe + pj) / 3; if (pm == 100 || pe == 100 || pj == 100){ return 1; } else if ((pm + pe) / 2 >= 90){ return 1; } else if (ave >= 80){ return 1; } else if (ave >= 70){ return 2; } else if (ave >= 50 && (pm >= 80 || pe >= 80)){ return 2; } else { return 0; } }
a.cc:2:10: error: expected identifier before '(' token 2 | int class(int pm, int pe, int pj); | ^ a.cc:2:11: error: expected unqualified-id before 'int' 2 | int class(int pm, int pe, int pj); | ^~~ a.cc:2:11: error: expected ')' before 'int' 2 | int class(int pm, int pe, int pj); | ~^~~ | ) a.cc: In function 'int main()': a.cc:11:13: error: expected primary-expression before 'class' 11 | if (class(pm, pe, pj) == 1){ | ^~~~~ a.cc:11:13: error: expected ')' before 'class' 11 | if (class(pm, pe, pj) == 1){ | ~^~~~~ | ) a.cc:13:20: error: expected primary-expression before 'class' 13 | } else if (class(pm, pe, pj) == 2){ | ^~~~~ a.cc:13:20: error: expected ')' before 'class' 13 | } else if (class(pm, pe, pj) == 2){ | ~^~~~~ | ) a.cc: At global scope: a.cc:22:10: error: expected identifier before '(' token 22 | int class(int pm, int pe, int pj) | ^ a.cc:22:11: error: expected unqualified-id before 'int' 22 | int class(int pm, int pe, int pj) | ^~~ a.cc:22:11: error: expected ')' before 'int' 22 | int class(int pm, int pe, int pj) | ~^~~ | )
s588694664
p00218
C++
#include <stdio.h> char class(int pm, int pe, int pj); int main(void) { int n, pm, pe, pj; scanf("%d", &n); for (int i = 0;i < n;i ++){ scanf("%d %d %d", &pm, &pe, &pj); printf("%c\n", class(pm, pe, pj)); } return 0; } char class(int pm, int pe, int pj) { int ave = (pm + pe + pj) / 3; if (pm == 100 || pe == 100 || pj == 100){ return 'A'; } else if ((pm + pe) / 2 >= 90){ return 'A'; } else if (ave >= 80){ return 'A'; } else if (ave >= 70){ return 'B'; } else if (ave >= 50 && (pm >= 80 || pe >= 80)){ return 'B'; } else { return 'C'; } }
a.cc:2:11: error: expected identifier before '(' token 2 | char class(int pm, int pe, int pj); | ^ a.cc:2:12: error: expected unqualified-id before 'int' 2 | char class(int pm, int pe, int pj); | ^~~ a.cc:2:12: error: expected ')' before 'int' 2 | char class(int pm, int pe, int pj); | ~^~~ | ) a.cc: In function 'int main()': a.cc:10:24: error: expected primary-expression before 'class' 10 | printf("%c\n", class(pm, pe, pj)); | ^~~~~ a.cc: At global scope: a.cc:15:11: error: expected identifier before '(' token 15 | char class(int pm, int pe, int pj) | ^ a.cc:15:12: error: expected unqualified-id before 'int' 15 | char class(int pm, int pe, int pj) | ^~~ a.cc:15:12: error: expected ')' before 'int' 15 | char class(int pm, int pe, int pj) | ~^~~ | )
s615186176
p00218
C++
#include <cstdio> #include <stdio.h> #include <iostream> #include <iomanip> #include <string> #include <vector> using namespace std; int main(){ int n; while(cin >> n){ int t[3],tt[2]; string ans[n]; for(int i = 1;n >= i;i++){ for(int ii = 1;3 >= ii;ii++){ cin >> t[1] >> t[2] >> t[3]; tt[1] = ( t[1] + t[2] ) / 2; tt[2] = ( t[1] + t[2] + t[3]) / 3; if(t[1] == 100 or t[2] == 100 or t[3] == 100 or tt[1] >= 90 or t[2] >= 80){ ans[i] = "A"; }else if(tt[2] >= 70){ ans[i] = "B"; }else if(tt[2] >= 50 and t[1] >= 80 or tt[2] >= 50 and t[2] >= 80){ ans[i] = "B"; }else{ ans[i] = "C"; } } } for(int iii = 1;n >= iii;iii++){ cout << ans[i] << endl; } }
a.cc: In function 'int main()': a.cc:31:29: error: 'i' was not declared in this scope 31 | cout << ans[i] << endl; | ^ a.cc:33:2: error: expected '}' at end of input 33 | } | ^ a.cc:9:11: note: to match this '{' 9 | int main(){ | ^
s961470784
p00218
C++
#include <cstdio> #include <stdio.h> #include <iostream> #include <iomanip> #include <string> #include <vector> using namespace std; int main(){ int n; while(cin >> n){ int t[3],tt[2]; string ans[n]; for(int i = 1;n >= i;i++){ for(int ii = 1;3 >= ii;ii++){ cin >> t[1] >> t[2] >> t[3]; tt[1] = ( t[1] + t[2] ) / 2; tt[2] = ( t[1] + t[2] + t[3]) / 3; if(t[1] == 100 or t[2] == 100 or t[3] == 100 or tt[1] >= 90 or t[2] >= 80){ ans[i] = "A"; }else if(tt[2] >= 70){ ans[i] = "B"; }else if(tt[2] >= 50 and t[1] >= 80 or tt[2] >= 50 and t[2] >= 80){ ans[i] = "B"; }else{ ans[i] = "C"; } } } for(int iii = 1;n >= iii;iii++){ cout << ans[iii] << endl; } }
a.cc: In function 'int main()': a.cc:33:2: error: expected '}' at end of input 33 | } | ^ a.cc:9:11: note: to match this '{' 9 | int main(){ | ^
s191492293
p00218
C++
#include <iostream> using namespace std; int main(){ int n,pj,pm,pe; while(1){ cin>>n if(n==0) break; for(int i=1;i<=n;i++){ cin>>pm>>pe>>pj; if(pm==100||pe==100||pm==100){ cout<<"A"<<endl; }else if((pm+pe)/2>=90){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=80){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=70){ cout<<"B"<<endl; }else if((pm+pe+pj)/3>=50&&pe=>80||pm>=80){ cout<<"B"<<endl; }else{ cout<<"C"<<endl; } } } }
a.cc: In function 'int main()': a.cc:6:23: error: expected ';' before 'if' 6 | cin>>n | ^ | ; 7 | if(n==0) break; | ~~ a.cc:19:55: error: expected primary-expression before '>' token 19 | }else if((pm+pe+pj)/3>=50&&pe=>80||pm>=80){ | ^
s503691462
p00218
C++
#include <iostream> using namespace std; int main(){ int n,pj,pm,pe; while(1){ cin>>n if(n==0) break; for(int i=1;i<=n;i++){ cin>>pm>>pe>>pj; if(pm==100||pe==100||pj==100){ cout<<"A"<<endl; }else if((pm+pe)/2>=90){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=80){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=70){ cout<<"B"<<endl; }else if((pm+pe+pj)/3>=50&&pe=>80||pm>=80){ cout<<"B"<<endl; }else{ cout<<"C"<<endl; } } } }
a.cc: In function 'int main()': a.cc:6:23: error: expected ';' before 'if' 6 | cin>>n | ^ | ; 7 | if(n==0) break; | ~~ a.cc:19:55: error: expected primary-expression before '>' token 19 | }else if((pm+pe+pj)/3>=50&&pe=>80||pm>=80){ | ^
s735952331
p00218
C++
#include <iostream> using namespace std; int main(){ int n,pj,pm,pe; while(1){ cin>>n; if(n==0) break; for(int i<=1;i<=n;i++){ cin>>pm>>pe>>pj; if(pm==100||pj==100||pe==100){ cout<<"A"<<endl; }else if((pm+pe)/2>=90){ cout<<"A"<<endl; }else if(pm/3+pe/3+pj/3>=80){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=70){ cout<<"B"<<endl; }else if((pm+pe+pj)/3>=50&&pm>=80||pe>=80){ coout<<"B"<<endl; }else{ cout<<endl; } } } }
a.cc: In function 'int main()': a.cc:8:26: error: expected ';' before '<=' token 8 | for(int i<=1;i<=n;i++){ | ^~ | ; a.cc:8:26: error: expected primary-expression before '<=' token 8 | for(int i<=1;i<=n;i++){ | ^~ a.cc:8:34: error: expected ')' before ';' token 8 | for(int i<=1;i<=n;i++){ | ~ ^ | ) a.cc:8:35: error: 'i' was not declared in this scope 8 | for(int i<=1;i<=n;i++){ | ^
s526946352
p00218
C++
#include <iostream> using namespace std; int main(){ int n,pj,pm,pe; while(1){ cin>>n; if(n==0) break; for(int i<=1;i<=n;i++){ cin>>pm>>pe>>pj; if(pm==100||pj==100||pe==100){ cout<<"A"<<endl; }else if((pm+pe)/2>=90){ cout<<"A"<<endl; }else if(pm/3+pe/3+pj/3>=80){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=70){ cout<<"B"<<endl; }else if((pm+pe+pj)/3>=50&&pm>=80||pe>=80){ cout<<"B"<<endl; }else{ cout<<"C"<<endl; } } } }
a.cc: In function 'int main()': a.cc:8:26: error: expected ';' before '<=' token 8 | for(int i<=1;i<=n;i++){ | ^~ | ; a.cc:8:26: error: expected primary-expression before '<=' token 8 | for(int i<=1;i<=n;i++){ | ^~ a.cc:8:34: error: expected ')' before ';' token 8 | for(int i<=1;i<=n;i++){ | ~ ^ | ) a.cc:8:35: error: 'i' was not declared in this scope 8 | for(int i<=1;i<=n;i++){ | ^
s348758468
p00218
C++
#include <iostream> using namespace std; int main(){ int n,pj,pm,pe; while(1){ cin>>n; if(n==0) break; for(int i<=1;i<=n;i++){ cin>>pm>>pe>>pj; if(pm==100||pj==100||pe==100){ cout<<"A"<<endl; }else if((pm+pe)/2>=90){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=80){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=70){ cout<<"B"<<endl; }else if((pm+pe+pj)/3>=50&&pm>=80||pe>=80){ cout<<"B"<<endl; }else{ cout<<"C"<<endl; } } } }
a.cc: In function 'int main()': a.cc:8:26: error: expected ';' before '<=' token 8 | for(int i<=1;i<=n;i++){ | ^~ | ; a.cc:8:26: error: expected primary-expression before '<=' token 8 | for(int i<=1;i<=n;i++){ | ^~ a.cc:8:34: error: expected ')' before ';' token 8 | for(int i<=1;i<=n;i++){ | ~ ^ | ) a.cc:8:35: error: 'i' was not declared in this scope 8 | for(int i<=1;i<=n;i++){ | ^
s259713685
p00218
C++
#include <iostream> using namespace std; int main(){ int n,pj,pm,pe; while(1){ cin>>n; if(n==0) break; for(int i<=1;i<=n;i++){ cin>>pm>>pe>>pj; if(pm==100||pj==100||pe==100){ cout<<"A"<<endl; }else if((pm+pe)/2>=90){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=80){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=70){ cout<<"B"<<endl; }else if((pm+pe+pj)/3>=50&&pm>=80||(pm+pe+pj)/3>=50&&pe>=80){ cout<<"B"<<endl; }else{ cout<<"C"<<endl; } } } }
a.cc: In function 'int main()': a.cc:8:26: error: expected ';' before '<=' token 8 | for(int i<=1;i<=n;i++){ | ^~ | ; a.cc:8:26: error: expected primary-expression before '<=' token 8 | for(int i<=1;i<=n;i++){ | ^~ a.cc:8:34: error: expected ')' before ';' token 8 | for(int i<=1;i<=n;i++){ | ~ ^ | ) a.cc:8:35: error: 'i' was not declared in this scope 8 | for(int i<=1;i<=n;i++){ | ^
s946085239
p00218
C++
#include <iostream> using namespace std; int main(){ int n,pj,pm,pe; while(n){ cin>>n; for(int i<=1;i<=n;i++){ cin>>pm>>pe>>pj; if(pm==100||pj==100||pe==100){ cout<<"A"<<endl; }else if((pm+pe)/2>=90){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=80){ cout<<"A"<<endl; }else if((pm+pe+pj)/3>=70){ cout<<"B"<<endl; }else if((pm+pe+pj)/3>=50&&pm>=80||pe>=80){ cout<<"B"<<endl; }else{ cout<<"C"<<endl; } } } }
a.cc: In function 'int main()': a.cc:7:26: error: expected ';' before '<=' token 7 | for(int i<=1;i<=n;i++){ | ^~ | ; a.cc:7:26: error: expected primary-expression before '<=' token 7 | for(int i<=1;i<=n;i++){ | ^~ a.cc:7:34: error: expected ')' before ';' token 7 | for(int i<=1;i<=n;i++){ | ~ ^ | ) a.cc:7:35: error: 'i' was not declared in this scope 7 | for(int i<=1;i<=n;i++){ | ^
s311399171
p00218
C++
#include <iostream> char detClass(int pm, int pe, int pj) { mean = (pm + pe + pj)/3; if((pm == 100) | (pe == 100) | (pj == 100)) { return 'A'; } else if( (pm + pe)/2 >= 90) { return 'A'; } else if( mean >= 80) { return 'A'; } else if( mean >= 70) { return 'B'; } else if( (mean >= 50) && ((pm >= 80) | (pe >= 80))) { return 'B'; } else { return 'C'; } } int main() { int n, pm, pe, pj = 0; while(true) { std::cin >> n; if(n == 0) { break; } for(int i = 0; i < n; i++) { std::cin >> pm >> pe >> pj; std::cout << detClass(pm,pe,pj) << std::endl; } } return 0; }
a.cc: In function 'char detClass(int, int, int)': a.cc:5:9: error: 'mean' was not declared in this scope 5 | mean = (pm + pe + pj)/3; | ^~~~ a.cc:19:1: warning: control reaches end of non-void function [-Wreturn-type] 19 | } | ^
s335706542
p00218
C++
#include<<iostream> #include<algorithm> using namespace std; char hyakuten(int *students[][3],int n){ for(int i=0;i<3;i++){ if(students[n][i]==100)return 'A'; } if((students[n][0]+students[n][1])/2>=90)return 'A'; if((students[n][0]+students[n][1]+students[n][2])/3>=80)return 'A'; if((students[n][0]+students[n][1]+students[n][2])/3>=70)return 'B'; if((studnets[n][0]+studnets[n][1]+students[n][2])/3>=50&&students[n][0]>=80||students[n][1]>=80)return 'B'; return 'C'; } int main(){ int n; while(cin>>n&&n){ int students[10000][3]; for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ cin>>students[i][j]; } } for(int i=0;i<n;i++){ cout<<hyakuten(i)<<endl; } } return 0; }
a.cc:1:9: fatal error: <iostream: No such file or directory 1 | #include<<iostream> | ^~~~~~~~~~~ compilation terminated.