submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s756337142
p00001
C++
#include <iostream> int main() { using namespace std; int max = 0; int second = 0; int third = 0; int n[10]; for(int i = 0; i < 10; i++) cin >> n[i]; sort(n,n+10,greater<int>()); max = n[0]; second = n[1]; third = n[2]; cout << max << "\n" << second <<...
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(n,n+10,greater<int>()); | ^~~~ | short
s041089555
p00001
C++
#include<iostream> #include<vector> #include<algorithm> int main(){ std::vector<int> vech; for(int i = 0; i < 10; i++){ std::cin >> vec[i]; } std::sort(vec.begin(), vec.end(), std::greater<int>()); for(int i = 0; i < 3; i++){ std::cout << vec[i] << std::endl; } }
a.cc: In function 'int main()': a.cc:8:17: error: 'vec' was not declared in this scope; did you mean 'vech'? 8 | std::cin >> vec[i]; | ^~~ | vech a.cc:10:13: error: 'vec' was not declared in this scope; did you mean 'vech'? 10 | std::sort(vec.begin(), vec.end(), ...
s754946293
p00001
C++
#include<stdio.h> int main(void) { int mount; for(int f1=0;f1<10;f1++){ scanf("%d",&mount[f1]); } int mem; for(int f1=0;f1<10;f1++){ for(int f2=0;f2<10;f2++){ if(mount[f1]>mount[f2]){ mem=mount[f1]; mount[f1]=mount[f2]; mount[f2]=mem; } } } for(int f1=0;f1<3;f1++){ printf("%d\n",mount[f1]); } return 0; }
a.cc: In function 'int main()': a.cc:6:18: error: invalid types 'int[int]' for array subscript 6 | scanf("%d",&mount[f1]); | ^ a.cc:11:9: error: invalid types 'int[int]' for array subscript 11 | if(mount[f1]>mount[f2]){ | ^ a.cc:11:19: error: invalid types 'int[int]' for arra...
s130210999
p00001
C++
#include<iostream> using namespace std; int main(){ int m; int m1=0,m2=0,m3=0; for(int i=0;i<10i++){ cin << m << endl; if(m1>m){ m3 = m2; m2 = m1; m1 = m; } else if(m2>m){ m3 = m2; m2 = m; } else if(m3>m){ m3 = m2; } } cout << m1 << ...
a.cc: In function 'int main()': a.cc:6:20: error: lvalue required as increment operand 6 | for(int i=0;i<10i++){ | ^~ a.cc:6:22: error: expected ';' before ')' token 6 | for(int i=0;i<10i++){ | ^ | ; a.cc:7:9: error: no match for...
s508324523
p00001
C++
#include <iostream> #include <algorithm> #include <vector> #include <functional> using namespace std; int main() { vector<int> v; for(int i = 0; i < 10; ++i) { int a; cin >> a; v.push_back(a); } sort(v.begin(), v.end(), greater<int>()); for(int i = 0; i < 3; ++i) cout << v[i] << endl; return 0;...
a.cc:24:5: error: redefinition of 'int main()' 24 | int main() { | ^~~~ a.cc:7:5: note: 'int main()' previously defined here 7 | int main() { | ^~~~
s756500527
p00001
C++
#include<iostream> using namespace std; void main() { int h[10]; int i,j,t; for(i=0;i<10;i++) cin>>h[i]; for(j=0;j<3;j++) { for(i=j+1;i<9;i++) { if(h[j]<h[i]) { t=h[j]; h[j]=h[i]; h[i]=t; } } } for(i=0;i<3;i++) cout<<h[i]<<endl; }
a.cc:3:1: error: '::main' must return 'int' 3 | void main() | ^~~~
s459834372
p00001
C++
#include<iostream> using namespace std; void main() { int h[10]; int i,j,t; for(i=0;i<10;i++) cin>>h[i]; for(j=0;j<3;j++) { for(i=j+1;i<10;i++) { if(h[j]<h[i]) { t=h[j]; h[j]=h[i]; h[i]=t; } } cout<<h[j]<<endl; } }
a.cc:3:1: error: '::main' must return 'int' 3 | void main() | ^~~~
s491717920
p00001
C++
#include <iostream> #include <functional> #include <string> using namespace std; int main(){ int i; int high[10]; for(i = 0; i < 10; i++){ high[i] << cin; } partial_sort(high, high + 3, greater<int>()); cout << high[0] << endl << hiht[1] <...
a.cc: In function 'int main()': a.cc:10:25: error: no match for 'operator<<' (operand types are 'int' and 'std::istream' {aka 'std::basic_istream<char>'}) 10 | high[i] << cin; | ~~~~~~~ ^~ ~~~ | | | | int std::istream {...
s645656990
p00001
C++
#include <iostream> #include <functional> #include <string> using namespace std; int main(){ int i; int high[10]; for(i = 0; i < 10; i++){ high[i] << cin; } partial_sort(high, high + 3, greater<int>()); cout << high[0] << endl << hiht[1] <...
a.cc: In function 'int main()': a.cc:10:25: error: no match for 'operator<<' (operand types are 'int' and 'std::istream' {aka 'std::basic_istream<char>'}) 10 | high[i] << cin; | ~~~~~~~ ^~ ~~~ | | | | int std::istream {...
s561963957
p00001
C++
#include <iostream> using namespace std; int main() { int n[10],i=0; while (cin >> n[i]) i++; sort(n,n+i-1,greater<int>()); for (int j=0; j < 3; j++) { cout << n[j] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(n,n+i-1,greater<int>()); | ^~~~ | short
s477226059
p00001
C++
#include <iostream> using namespace std; int main() { int n[10],i=0; while (cin >> n[i]) i++; sort(n,n+i-1,greater<int>()); for (int j=0; j < 3; j++) { cout << n[j] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(n,n+i-1,greater<int>()); | ^~~~ | short
s438556046
p00001
C++
#include <iostream> using namespace std; int main(){ int mnt[10]; int i; int max; for(i=0;i<10;i++) { cin>>mnt[i]; } sort(mnt,mnt+10); reverse(mnt,mnt+10); for(i=0;i<3;i++) cout<<mnt[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:17:1: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(mnt,mnt+10); | ^~~~ | short a.cc:18:1: error: 'reverse' was not declared in this scope 18 | reverse(mnt,mnt+10); | ^~~~~~~
s887874060
p00001
C++
#include <iostream> using namespace std; int main(){ int mnt[10]; int i; for(i=0;i<10;i++) { cin>>mnt[i]; } sort(mnt,mnt+10); reverse(mnt,mnt+10); for(i=0;i<3;i++) cout<<mnt[i]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(mnt,mnt+10); | ^~~~ | short a.cc:13:1: error: 'reverse' was not declared in this scope 13 | reverse(mnt,mnt+10); | ^~~~~~~
s347923681
p00001
C++
#include<iostream> using namespace std; int main() { int D[10]; int i,k; for(i=1; i<=10; i++) { cin>>D[i]; } sort(D,D+10); reverse(D,D+10); for(k=1; k<=3; k++) { cout <<D...
a.cc: In function 'int main()': a.cc:14:14: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(D,D+10); | ^~~~ | short a.cc:15:14: error: 'reverse' was not declared in this scope 15 | reverse(D,D+10); | ^...
s036689248
p00001
C++
#include<stdio.h> #include<algorithm> using std::sort; main(){ int x[10]; for(i=0;i<10;i++) scanf("%d",&x[i]); sort(x,x+10); printf("%d\n%d\n%d",x[9],x[8],x[7]); }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:5: error: 'i' was not declared in this scope 6 | for(i=0;i<10;i++) | ^
s653774204
p00001
C++
#include<stdio.h>#include<algorithm>using std::sort;main(){int x[10],i;for(i=0;i<10;i++)scanf("%d",&x[i]);sort(x,x+10);printf("%d\n%d\n%d",x[9],x[8],x[7]);}
a.cc:1:18: warning: extra tokens at end of #include directive 1 | #include<stdio.h>#include<algorithm>using std::sort;main(){int x[10],i;for(i=0;i<10;i++)scanf("%d",&x[i]);sort(x,x+10);printf("%d\n%d\n%d",x[9],x[8],x[7]);} | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linu...
s649970494
p00001
C++
#include<iostream> using namespace std; int main(){ int x; int h[3]; for(int a=0;a<10;a++){ cin >> x; if(x>h[0]){ h[2] = h[1]; h[1] = h[0]; h[0] = x; }else if(x>h[1]){ h[2] = h[1]; h[1] = x; }else if(x>h[2]){ ...
a.cc: In function 'int main()': a.cc:20:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n"; | ~~~~ ^~ ~~~~ | | | | | int | std::ostream {ak...
s964166348
p00001
C++
#include<stdio.h> int main(void){ /* 宣言と初期化 */ int hai[10]; int i; int temp2nd; int temp3rd int tempmax; for(i=0;i<10;i++) { printf("山の高さ "); scanf("%d",hai[i]); } /* 代入 */ temp2nd=hai[0]; tempmax=hai[0]; temp3rd=hai[0] /* 計算 */ for(i=0;i<=10;i++){ /* 最大値求める *...
a.cc: In function 'int main()': a.cc:10:5: error: expected initializer before 'int' 10 | int tempmax; | ^~~ a.cc:19:5: error: 'tempmax' was not declared in this scope; did you mean 'tempnam'? 19 | tempmax=hai[0]; | ^~~~~~~ | tempnam a.cc:20:5: error: 'temp3rd' was not declare...
s081345186
p00001
C++
#include<stdio.h> int main(void){ /* 宣言と初期化 */ int hai[10]; int i; int temp2nd; int temp3rd; int tempmax; for(i=0;i<10;i++) { scanf("%d",&hai[i]); } /* 代入 */ temp2nd=hai[0]; tempmax=hai[0]; temp3rd=hai[0]; /* 計算 */ for(i=0;i<10;i++){ /* 最大値求める ...
a.cc:26:1: error: extended character   is not valid in an identifier 26 |    hai[i]=0;} | ^ a.cc:26:1: error: extended character   is not valid in an identifier a.cc: In function 'int main()': a.cc:26:1: error: '\U00003000\U00003000' was not declared in this scope 26 |    hai[i]=0;} | ^~~~ a.cc:...
s391548043
p00001
C++
#include<stdio.h> int main(void){ /* 宣言と初期化 */ int hai[10]; int id[2] int i; int temp2nd; int temp3rd; int tempmax; for(i=0;i<10;i++) { scanf("%d",&hai[i]); } /* 代入 */ temp2nd=hai[0]; tempmax=hai[0]; temp3rd=hai[0]; /* 計算 */ for(i=0;i<10;i+...
a.cc: In function 'int main()': a.cc:8:5: error: expected initializer before 'int' 8 | int i; | ^~~ a.cc:13:5: error: 'i' was not declared in this scope 13 | for(i=0;i<10;i++) | ^ a.cc:23:9: error: 'i' was not declared in this scope 23 | for(i=0;i<10;i++){ | ^ a.cc:26...
s717968186
p00001
C++
#include<stdio.h> int main(void){ /* 宣言と初期化 */ int hai[10]; int id[2] int i; int temp2nd; int temp3rd; int tempmax; for(i=0;i<10;i++) { scanf("%d",&hai[i]); } /* 代入 */ temp2nd=hai[0]; tempmax=hai[0]; temp3rd=hai[0]; /* 計算 */ for(i=0;i<1...
a.cc: In function 'int main()': a.cc:8:5: error: expected initializer before 'int' 8 | int i; | ^~~ a.cc:13:5: error: 'i' was not declared in this scope 13 | for(i=0;i<10;i++) | ^ a.cc:23:9: error: 'i' was not declared in this scope 23 | for(i=0;i<10;i++){ | ^ a.cc:26...
s954353576
p00001
C++
#include<stdio.h> int main(void){ /* 宣言と初期化 */ int hai[10]; int id[2] int i; int temp2nd; int temp3rd; int tempmax; for(i=0;i<10;i++) { scanf("%d",&hai[i]); } /* 代入 */ temp2nd=hai[0]; tempmax=hai[0]; temp3rd=hai[0]; /* 計算 */ for(i=0...
a.cc: In function 'int main()': a.cc:8:5: error: expected initializer before 'int' 8 | int i; | ^~~ a.cc:13:5: error: 'i' was not declared in this scope 13 | for(i=0;i<10;i++) | ^ a.cc:23:9: error: 'i' was not declared in this scope 23 | for(i=0;i<10;i++){ | ^ a.cc:26...
s377952702
p00001
C++
#include<stdio.h> int main(void){ /* 宣言と初期化 */ int hai[10]; int id[2] int i; int temp2nd; int temp3rd; int tempmax; for(i=0;i<10;i++) { scanf("%d",&hai[i]); } /* 代入 */ temp2nd=hai[0]; tempmax=hai[0]; temp3rd=hai[0]; /* 計算 */ for(i=0;i<10;i++){ ...
a.cc: In function 'int main()': a.cc:7:5: error: expected initializer before 'int' 7 | int i; | ^~~ a.cc:12:5: error: 'i' was not declared in this scope 12 | for(i=0;i<10;i++) | ^ a.cc:21:9: error: 'i' was not declared in this scope 21 | for(i=0;i<10;i++){ | ^ a.cc:24...
s498277898
p00001
C++
#include<stdio.h> int main(void){ /* 宣言と初期化 */ int hai[10]; int id[2]; int i; int temp2nd; int temp3rd; int tempmax; for(i=0;i<10;i++) { scanf("%d",&hai[i]); } /* 代入 */ temp2nd=hai[0]; tempmax=hai[0]; temp3rd=hai[0]; /* 計算 */ for(i=0;i<10;i++){ ...
a.cc: In function 'int main()': a.cc:28:42: error: lvalue required as left operand of assignment 28 | if(hai[i]<tempmax&&hai[i]>temp2nd&& i=! id[0]) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ a.cc:33:57: error: lvalue required as left operand of assignment 33 | if(hai[i]>temp3rd&&hai[i]...
s043038418
p00001
C++
#include<stdio.h> int main(void){ /* 宣言と初期化 */ int hai[10]; int id[2]; int i; int temp2nd; int temp3rd; int tempmax; for(i=0;i<10;i++) { cin >> hai[i]; } /* 代入 */ temp2nd=hai[0]; tempmax=hai[0]; temp3rd=hai[0]; /* 計算 */ for(i=0;i<10;i++){ ...
a.cc: In function 'int main()': a.cc:14:4: error: 'cin' was not declared in this scope 14 | cin >> hai[i]; | ^~~
s863060603
p00001
C++
#include<stdio.h> #include<algorithm> #include<iostream> using namespace std; int main(void){ /* 宣言と初期化 */ int hai[10]; int id[2]; int i; int temp2nd; int temp3rd; int tempmax; for(i=0;i<10;i++) { cin >> hai[i]; } /* 代入 */ temp2nd=hai[0]; tempmax=hai[0]; ...
a.cc: In function 'int main()': a.cc:30:24: error: expected ';' before '}' token 30 | hai[j]=tempmax | ^ | ; 31 | } | ~
s545532684
p00001
C++
#include <iostream> using namespace std; int main(){ int a[11],max1,max2,max3; for (int i=0; i<10; i++){ while (true){ cout << "山の高さ" << i+1 << "(整数)" ; cin >> a[i]; if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) { break; } } } max1 = a[0]; for (i=1; i<10; i++){ if (max1 < a[i...
a.cc: In function 'int main()': a.cc:22:14: error: 'i' was not declared in this scope 22 | for (i=1; i<10; i++){ | ^ a.cc:29:14: error: 'i' was not declared in this scope 29 | for (i=2; i<10; i++){ | ^ a.cc:36:14: error: 'i' was not declared in this scope 3...
s917792026
p00001
C++
#include <iostream> using namespace std; int main(){ int a[11],max1,max2,max3; for (int i=0; i<10; i++){ while (true){ cout << "山の高さ" << i+1 << "(整数)" ; cin >> a[i]; if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) { break; } } } max1 = a[0]; for (i=1; i<10; i++){ if (max1 < a[i]...
a.cc: In function 'int main()': a.cc:20:14: error: 'i' was not declared in this scope 20 | for (i=1; i<10; i++){ | ^ a.cc:27:14: error: 'i' was not declared in this scope 27 | for (i=2; i<10; i++){ | ^ a.cc:34:14: error: 'i' was not declared in this scope 3...
s373939841
p00001
C++
#include <iostream> using namespace std; int main(){ int a[10],max1,max2,max3; for (int i=0; i<10; i++){ while (true){ cout << "山の高さ" << i+1 << "(整数)" ; cin >> a[i]; if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) { break; } } } max1 = a[0]; for (i=1; i<10; i++){ if (max1 < a[i]...
a.cc: In function 'int main()': a.cc:20:14: error: 'i' was not declared in this scope 20 | for (i=1; i<10; i++){ | ^ a.cc:27:14: error: 'i' was not declared in this scope 27 | for (i=2; i<10; i++){ | ^ a.cc:34:14: error: 'i' was not declared in this scope 3...
s296845140
p00001
C++
#include <iostream> using namespace std; int main(){ int a[11],max1,max2,max3; for (int i=1; i<11; i++){ while (true){ cout << "山の高さ" << i << "(整数)" ; cin >> a[i]; if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) { break; } } } max1 = a[1]; for (i=2; i<11; i++){ if (max1 < a[i]){...
a.cc: In function 'int main()': a.cc:20:14: error: 'i' was not declared in this scope 20 | for (i=2; i<11; i++){ | ^ a.cc:27:14: error: 'i' was not declared in this scope 27 | for (i=3; i<11; i++){ | ^ a.cc:34:14: error: 'i' was not declared in this scope 3...
s780586085
p00001
C++
#include <iostream> using namespace std; int main(){ int a[11],max1,max2,max3; for (int i=1; i<11; i++){ while (true){ cout << "山の高さ" << i << "(整数)" ; cin >> a[i]; if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) { break; }}} max1 = a[1]; for (i=2; i<11; i++){ if (max1 < a[i]){ swap (max1,a...
a.cc: In function 'int main()': a.cc:11:14: error: 'i' was not declared in this scope 11 | for (i=2; i<11; i++){ | ^ a.cc:16:14: error: 'i' was not declared in this scope 16 | for (i=3; i<11; i++){ | ^ a.cc:21:14: error: 'i' was not declared in this scope 2...
s717091295
p00001
C++
#include <iostream> using namespace std; void cswap(int &x, int &y) { int tmp = x; x = y; y = tmp; } int main(void){ int a[11],max1,max2,max3; for (int i=1; i<11; i++){ while (true){ cout << "山の高さ" << i << "(整数)" ; cin >> a[i]; if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) { ...
a.cc: In function 'int main()': a.cc:27:14: error: 'i' was not declared in this scope 27 | for (i=2; i<11; i++){ | ^ a.cc:34:14: error: 'i' was not declared in this scope 34 | for (i=3; i<11; i++){ | ^ a.cc:41:14: error: 'i' was not declared in this scope 4...
s344391851
p00001
C++
#include <algorithm> #include <deque> #include <functional> #include <iostream> using namespace std; int main(){ int hills[10]; for(int i=0;i<10;i++)cin >> hills[i]; partial_sort( hills, hills + 3, hills+10, greater<int>() ); for(int i=0;i<3;i++) cout << hills[i] <<endl; return 0; }
a.cc:15:25: error: extended character   is not valid in an identifier 15 | for(int i=0;i<3;i++) cout << hills[i] <<endl; | ^ a.cc: In function 'int main()': a.cc:15:25: error: '\U00003000cout' was not declared in this scope 15 | for(int i=0;i<3;i++) cout << hills[i] <<endl; ...
s030299654
p00001
C++
#include <iostream> #include <string> #include <stringstream> #include <vector> #include <algorithm> #include <map> #include <cstdlib> using namespace std; #define REP(i,n) for(int i=0;i<n;++i) #define rep(n) REP(i,n) int main() { int hills[10]; rep(10) cin>>hills[i]; sort( hills, hills+9, greater<int>() ); rep...
a.cc:3:10: fatal error: stringstream: No such file or directory 3 | #include <stringstream> | ^~~~~~~~~~~~~~ compilation terminated.
s543046845
p00001
C++
#include <iostream> #include <string> #include <stringstream> #include <vector> #include <algorithm> #include <map> #include <cstdlib> using namespace std; #define REP(i,n) for(int i=0;i<n;++i) #define rep(n) REP(i,n) int hills[16]; int main() { rep(10) cin>>hills[i]; sort( hills, hills+10, greater<int>() ); rep...
a.cc:3:10: fatal error: stringstream: No such file or directory 3 | #include <stringstream> | ^~~~~~~~~~~~~~ compilation terminated.
s743238837
p00001
C++
#include <iostream> #include <set> using namespace std; int main(void){ int count = 0; set<int, greater<int> > nums; for (int i=0; i<10; ++i){ int num; cin >> num; nums.insert(num); } set<int, greater<int> >::iterator it = nums.begin(); while (it != nums.end() && (n<3)){ cout << *it << endl; ++it; } ...
a.cc: In function 'int main()': a.cc:15:37: error: 'n' was not declared in this scope 15 | while (it != nums.end() && (n<3)){ | ^
s597836763
p00001
C++
using namespace std; int main(){ vector <int> v; for(int i = 0;i < 10;i++){ int n; cin >> n; v.push_back(n); } sort(v.begin(), v.end()); //cout << endl; for(int i = 9; i >=7;i--){ cout << v[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:4:9: error: 'vector' was not declared in this scope 4 | vector <int> v; | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vector> 1 | using namespace std; a.c...
s471319523
p00001
C++
#include <iostream> #include <stdio.h> using namespace std; int main() { int i, j, a[10]; for(i=0;i<10;i++){ scanf("%d", &a[i]); } sort(a,a+10); for(j=0;j<3;j++){ printf("%d\n", a[9-j]); } }
a.cc: In function 'int main()': a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(a,a+10); | ^~~~ | short
s898718342
p00001
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s442179380
p00001
C++
#include<iostream> using namespace std; int main() { int a[10]; for(int i=0; i<10; i++){ cin>>a[i]; } int T=0; for(int j=1; j==0; j++;){ T=0; for(int i=0; i<9; i++){ if(a[i]<a[i+1]){ int L; L=a[i]; a[i]=a[i+1]; a[i+1]=L; T=1; } } if(T=0) break; } for(int i=0; i<3; i++){ ...
a.cc: In function 'int main()': a.cc:12:31: error: expected ')' before ';' token 12 | for(int j=1; j==0; j++;){ | ~ ^ | ) a.cc:12:32: error: expected primary-expression before ')' token 12 | for(int j=1; j==0; j++;){ | ...
s341531713
p00001
C++
#include<iostream> int main(){ int a[10]; for(int k=0;k<10;k++){ cin>>a[k]>>endl; } for(int i = 0; i < 10; i++){ for(int j = i + 1; j < 10; j++){ if(a[i] > a[j]){ dumy = a[i]; a[i] = a[j]; a[j] = dumy; } } } for(int k=0;k<10;k++){ cout<<a[0] <<a[1] <<a[2]<<endl; } return 0}
a.cc: In function 'int main()': a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin>>a[k]>>endl; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to st...
s758454255
p00001
C++
#include<iostream> using namespace std; int main(){ int a[10]; for(int k=0;k<10;k++){ cin>>a[k]>>endl; } for(int i = 0; i < 10; i++){ for(int j = i + 1; j < 10; j++){ if(a[i] > a[j]){ dumy = a[i]; a[i] = a[j]; a[j] = dumy; } } } for(int k=0;k<10;k++){ cout<<a[0] <<a[1] <<a[2]<<endl; } return 0}
a.cc: In function 'int main()': a.cc:10:10: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 10 | cin>>a[k]>>endl; | ~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:42,...
s512396614
p00001
C++
#include<iostream> using namespace std; int main(){ int a[10]; for(int k=0;k<10;k++){ cin>>a[k]>>endl; } for(int i = 0; i < 10; i++){ for(int j = i + 1; j < 10; j++){ if(a[i] > a[j]){ dumy = a[i]; a[i] = a[j]; a[j] = dumy; } } } for(int k=0;k<10;k++){ cout<<a[0] <<a[1] <<a[2]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:10: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 10 | cin>>a[k]>>endl; | ~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:42,...
s805107827
p00001
C++
arr = [] for cnt in 0...10 arr.push(gets.chomp.to_i()) end arr.sort!.reverse! for cnt in 0...3 puts(arr[cnt]) end
a.cc:2:12: error: too many decimal points in number 2 | for cnt in 0...10 | ^~~~~~ a.cc:8:12: error: too many decimal points in number 8 | for cnt in 0...3 | ^~~~~ a.cc:1:1: error: 'arr' does not name a type 1 | arr = [] | ^~~
s430241546
p00001
C++
#include<iostream> using namespace std; int main(){ int i=0; int m[10]; for(i=0;i<10;i++) { cin>>m[i]; while(0>m[i]||m[i]>10000) cin>>m[i]; } sort(m[0], m[9], greater<int>()); cout<<m[0]<<endl<<m[1]<<endl<<m[2]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(m[0], m[9], greater<int>()); | ^~~~ | short
s921087573
p00001
C++
#include<iostream> #include <algorithm> #include <functional> using namespace std; int main(){ int i=0; int m[10]; for(i=0;i<10;i++) { cin>>m[i]; while(0>m[i]||m[i]>10000) cin>>m[i]; } sort(m[0], m[9], greater<int>()); cout<<m[0]<<endl<<m[1]<<endl<<m[2]<<endl; return 0; }
In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> ...
s398500015
p00001
C++
#include <iostream> #include <algorithm> using namespace std; int main(void){ int mountain[10]; for( int i = 0 ; i < 10 ; i++ ){ cin >> mountain[i]; } sort( mountain , mountain + 10 ); cout << mountain[9] << endl << mountain[8] << endl; <<mountain[7] << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:55: error: expected primary-expression before '<<' token 16 | cout << mountain[9] << endl << mountain[8] << endl; <<mountain[7] << endl; | ^~
s546721620
p00001
C++
#include <iostream> int main() { int best[] = {0, 0, 0}; int t; for(int i = 0; i < 10; ++i) { std::cin << t << std::endl; for(int j = 0; j < 3; ++j) { if(t > best[j]) { for(int k = 3; k > j; --k) best[k] = best[k - 1]; best[j] = t; } } for(int i =...
a.cc: In function 'int main()': a.cc:9:14: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 9 | std::cin << t << std::endl; | ~~~~~~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_...
s178131506
p00001
C++
#include<iostream> #include<vector> using namespace std; int main(){ int a=0; std::vector<int> vec(10); for(int i=0;i<10;i++){ std::cin>>vec[i]; } /*for(int d=0;d<3;d++){ for(int i=0;i<10;i++){ if(vec[i]>a)a=vec[i]; } std::cout<<a<<std::endl; for(int i=0;i<10;i++){ if(vec[i]==a)vec[i]=0; } a=0;...
a.cc: In function 'int main()': a.cc:29:18: error: expected '}' at end of input 29 | return 0; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s920248792
p00001
C++
#include<cstdio> #include<cstring> int main(){ int n[10],a; for (int f=0;f<10;f++){ scanf("%d",&n[f]); } for(int f1=0;f1<10;f1++){ for(int f2=0;f2<10;f2++){ a=max(a,max(n[f1],n[f2])); } } printf("%d",a); return 0; }
a.cc: In function 'int main()': a.cc:11:21: error: 'max' was not declared in this scope 11 | a=max(a,max(n[f1],n[f2])); | ^~~ a.cc:11:15: error: 'max' was not declared in this scope 11 | a=max(a,max(n[f1],n[f2])); | ^~~
s946319921
p00001
C++
#include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; }
a.cc:1:19: warning: extra tokens at end of #include directive 1 | #include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; } | ^ /usr/bin/ld: /usr/l...
s524170965
p00001
C++
#include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; }
a.cc:1:19: warning: extra tokens at end of #include directive 1 | #include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; } | ^ /usr/bin/ld: /usr/l...
s186715452
p00001
C++
include <iostream> int main(){ int first=0,second=0,third=0,height; for(int i=0;i<10;++i){ height=get(); if(height>first){ second=first; first=height; } else if(height>second){ third=second; second=height; } else if(height>third){ third=height; } } std::cout<<first<<'\n'<<second<<'\n'<...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~
s150478444
p00001
C++
#include <iostream> int main(){ int first=0,second=0,third=0,height; for(int i=0;i<10;++i){ height=get(); if(height>first){ second=first; first=height; } else if(height>second){ third=second; second=height; } else if(height>third){ third=height; } } std::cout<<first<<'\n'<<second<<'\n'...
a.cc: In function 'int main()': a.cc:6:24: error: 'get' was not declared in this scope; did you mean 'std::get'? 6 | height=get(); | ^~~ | std::get In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /us...
s484988320
p00001
C++
#include <iostream> int main(){ int first=0,second=0,third=0,height; for(int i=0;i<10;++i){ cin>>height; if(height>first){ second=first; first=height; } else if(height>second){ third=second; second=height; } else if(height>third){ third=height; } } std::cout<<first<<'\n'<<second<<'\n'<...
a.cc: In function 'int main()': a.cc:6:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>height; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | ex...
s842584499
p00001
C++
#include <iostream> #include <vector> using namespace std; int main(){ vector<int> height; int h; while (cin>>h) { height.push_back(h); } sort(height.begin(), height.end()); for(int i=1;i<=3;i++){ cout<<height[height.size()-i]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(height.begin(), height.end()); | ^~~~ | short
s794709921
p00001
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ vector <int> v; int a; for(int i-;i<10;i++){ cin >> a; v.push_back(a); } sort(v.begin(),v.end); cout << v[0] << endl << v[1] << endl << v[2] << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:10: error: expected ';' before '-' token 9 | for(int i-;i<10;i++){ | ^ | ; a.cc:9:11: error: expected primary-expression before ';' token 9 | for(int i-;i<10;i++){ | ^ a.cc:9:16: error: expected ')' before ';' token 9 | for...
s032178846
p00001
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ vector <int> v; int a; for(int i-;i<10;i++){ cin >> a; v.push_back(a); } sort(v.begin(),v.end()); cout << v[0] << endl << v[1] << endl << v[2] << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:14: error: expected ';' before '-' token 9 | for(int i-;i<10;i++){ | ^ | ; a.cc:9:15: error: expected primary-expression before ';' token 9 | for(int i-;i<10;i++){ | ^ a.cc:9:20: error: expected ')' before '...
s824139085
p00001
C++
//#pragma comment(linker,"/STACK:102400000,102400000") #include<iostream> #include<cstdlib> #include<cstdio> #include<algorithm> #include<cstring> #include<queue> #include<cmath> #define M 40000 using namespace std; typedef struct yyyy { int h; double s[5],t[5]; }yyy; double h; double l[3],r[3]; const dou...
a.cc: In function 'int main()': a.cc:123:26: error: request for member 'tt' in 'a[(++ tim)]', which is of non-class type 'double' 123 | a[++tim].tt | ^~
s081527881
p00001
C++
#include <iostream> using namespace std; int main() { int a[10]; int b; for(int i=0;i<10;i++){ cin>>b; a[i]=b; } sort(a,a+10,greater<int>()); cout<<a[0]<<endl; cout<<a[1]<<endl; cout<<a[2]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:1: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(a,a+10,greater<int>()); | ^~~~ | short
s266685428
p00001
C++
#include <iostream> using namespace std; int main() { int a[10]; int b; for(int i=0;i<10;i++){ cin>>b; a[i]=b; } sort(a,a+10,greater<int>()); cout<<a[0]<<endl; cout<<a[1]<<endl; cout<<a[2]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:1: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(a,a+10,greater<int>()); | ^~~~ | short
s140306954
p00001
C++
#include <iostream> using namespace std; int main() { int a[10]; int b; for(int i=0;i<10;i++){ cin>>b; a[i]=b; } sort(a,a+10,greater<int>()); cout<<a[0]<<endl; cout<<a[1]<<endl; cout<<a[2]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:1: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(a,a+10,greater<int>()); | ^~~~ | short
s453955092
p00001
C++
#include<stdio.h> int main() { long long int ansh[11],i,n,a=0,b=0,c=0; for(i=1;i<=10;i++){ scanf("%lld",&ansh[i]); if(a<=ansh[i]){ c=b; y=a; a=ansh[i]; } else if(b<=ansh[i]){ c=b; y=ansh[i]; } else if(z<...
a.cc: In function 'int main()': a.cc:9:13: error: 'y' was not declared in this scope 9 | y=a; | ^ a.cc:14:13: error: 'y' was not declared in this scope 14 | y=ansh[i]; | ^ a.cc:16:17: error: 'z' was not declared in this scope 16 | else if(z<=...
s013237562
p00001
C++
#include <iostream> using namespace std; int a[3],n; int main(){ a[0] = 0; a[1] = 0; a[2] = 0; for(int i = 0; i < 10; i++){ cin >> n; if(a[2] > n){ break; }else{ if(a[1] > n){ a[2] = n; }else{ if(a[0] > n){ a[2] = a[1]; a[1] = n; }else{...
a.cc: In function 'int main()': a.cc:29:35: error: 'andl' was not declared in this scope 29 | cout << a[0] << endl << a[1] << andl << a[2] << endl | ^~~~
s870137341
p00001
C++
#include <iostream> using namespace std; int a[3],n; int main(){ a[0] = 0; a[1] = 0; a[2] = 0; for(int i = 0; i < 10; i++){ cin >> n; if(a[2] > n){ break; }else{ if(a[1] > n){ a[2] = n; }else{ if(a[0] > n){ a[2] = a[1]; a[1] = n; }els...
a.cc: In function 'int main()': a.cc:29:35: error: 'andl' was not declared in this scope 29 | cout << a[0] << endl << a[1] << andl << a[2] << endl; | ^~~~
s787326006
p00001
C++
#include <stdio.h> const int tall[10] = { 1819, 2003, 876, 2840, 1723, 1673, 3776, 2848, 1592, 922 }; int main(void) { int sort[3] = {0, 0, 0}; int i; int temp; for(i = 0; i < 10; i++){ if(tall[i] > sort[0]){ sort[2] = sort[1]; sort[1] = sort[0]; sort[0] = tall[i]; } else if(tall[i] > s...
a.cc:36:18: error: stray '\' in program 36 | printf(%d\n%d\n%d, sort[0], sort[1], sort[2]); | ^ a.cc:36:22: error: stray '\' in program 36 | printf(%d\n%d\n%d, sort[0], sort[1], sort[2]); | ^ a.cc: In function 'int main()': a.cc:36:16: error: expec...
s957905319
p00001
C++
#include <stdio.h> int main(void) { int sort[3] = {0, 0, 0}; int i; int temp; for(i = 0; i < 10; i++){ scanf("%d", &temp); if(tall[i] > sort[0]){ sort[2] = sort[1]; sort[1] = sort[0]; sort[0] = tall[i]; } else if(tall[i] > sort[1]){ sort[2] = sort[1]; sort[1] = tall[i]...
a.cc: In function 'int main()': a.cc:11:20: error: 'tall' was not declared in this scope 11 | if(tall[i] > sort[0]){ | ^~~~
s502954765
p00001
C++
#include <iostream> using namespace std; int main() { &#8195;&#8195;&#8195;int height[10]; &#8195;&#8195;&#8195;int tmp; &#8195;&#8195;&#8195;int i=0,j=0; &#8195;&#8195;&#8195;for (;i<10;i++) &#8195;&#8195;&#8195;&#8195;&#8195;&#8195;cin>>height[i]; &#8195;&#8195;&#8195;for (i=0;i<100;i++) &#8195;&#8195;&#8195;&#8195...
a.cc:5:2: error: stray '#' in program 5 | &#8195;&#8195;&#8195;int height[10]; | ^ a.cc:5:9: error: stray '#' in program 5 | &#8195;&#8195;&#8195;int height[10]; | ^ a.cc:5:16: error: stray '#' in program 5 | &#8195;&#8195;&#8195;int height[10]; | ^ a.cc:6:2: error:...
s607501558
p00001
C++
#include <iostream> using namespace std; int main(){ int a[] = {1819 ,2003 ,876 ,2840 ,1723 ,1673 ,3776 ,2848 ,1592 ,922}; int ma=0, aa = 0; for(int j=0;j<3;j++){ for(int i=0;i<10;i++){ if(ma > a[i]) ma = a[i]; aa = i; } cout << ma << endl; a[a] = 0; } return 0; }
a.cc: In function 'int main()': a.cc:23:2: error: invalid types 'int [10][int [10]]' for array subscript 23 | a[a] = 0; | ^
s112851193
p00001
C++
#include <iostream> using namespace std; int main(){ int a[10] = {1819,2003,876,2840,1723,1673,3776,2848,1592,922}; int ma=0, aa = 0; for(int j=0;j<3;j++){ for(int i=0;i<10;i++){ if(ma > a[i]){ ma = a[i]; aa = i; } } cout << ma << endl; a[a] = 0; } return 0; }
a.cc: In function 'int main()': a.cc:16:2: error: invalid types 'int [10][int [10]]' for array subscript 16 | a[a] = 0; | ^
s037745983
p00001
C++
#include <iostream> using namespace std; int main(){ int n[10]; for(int i=0;i<10;i++) cin >> n[i]; int a,b=0; for(int j=0;j<3;j++){ for(i=0;i<10;i++){ if(b<n[i]){ b = n[i]; a = i; } } cout << b; n[a] = 0; } return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'i' was not declared in this scope 10 | for(i=0;i<10;i++){ | ^
s488853417
p00001
C++
int main(){ int a[10]; int max = 0; int max2 = 0; int max3 = 0; int i; int tmp; for(i = 0; i < 10; i++){ std::cin >> a[i]; } for(i = 0; i< 10; i++){ if(max < a[i]){ max = a[i]; tmp = i; } } int tmp2; for(int i = 0; i< 10; i++){ if(max2 < a[i] && tmp != i){ max2 = a[i]; tmp2 = i; } } for(i = 0; i< 10; i++){ if(max...
a.cc: In function 'int main()': a.cc:10:6: error: 'cin' is not a member of 'std' 10 | std::cin >> a[i]; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | int main(){ a.cc:33:6: error: 'cout' is n...
s092665369
p00001
C++
int main(){ int a[10]; int max = 0; int max2 = 0; int max3 = 0; int i; int tmp; for(i = 0; i < 10; i++){ std::cin >> a[i]; } for(i = 0; i< 10; i++){ if(max < a[i]){ max = a[i]; tmp = i; } } int tmp2; for(int i = 0; i< 10; i++){ if(max2 < a[i] && tmp != i){ max2 = a[i]; tmp2 = i; } } for(i = 0; i< 10; i++){ if(max3...
a.cc: In function 'int main()': a.cc:10:6: error: 'cin' is not a member of 'std' 10 | std::cin >> a[i]; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | int main(){ a.cc:33:6: error: 'cout' is n...
s540909068
p00001
C++
#include <istream> #include <fstream> #define SIZE 10 #define TOPNUM 3 using namespace std; int main(){ ifstream ifs("data.txt"); if( !ifs ) return 1; int height[SIZE],top[TOPNUM+1]={0}; for( int i=0;i<SIZE;i++ ){ ifs>>height[i]; if( height[i]<0||10000<height[i] ) return 1; for( int j=0;j<TOPNUM;j++ ){ ...
a.cc: In function 'int main()': a.cc:26:17: error: 'cout' was not declared in this scope 26 | cout<<top[i]<<endl; | ^~~~ a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <fstream> +++ |+#in...
s134103475
p00001
C++
#include<iostream> #include<vector> #include<algorithm> int main(){ std::vector<int> o; for(int i=1;i<=10;i++)int in=0,o.push_back(in); std::sort(o.begin(),o.end()); std::cout<<o[7]<<std::endl<<o[8]<<std::endl<<o[9]<<std::endl; }
a.cc: In function 'int main()': a.cc:7:41: error: expected initializer before '.' token 7 | for(int i=1;i<=10;i++)int in=0,o.push_back(in); | ^
s884500836
p00001
C++
#include <iostream> using namespace std; #define N 10 int max(int x[], int n) { int i,j; j=0; for(i=1; i<n; i++) if(x[i]<x[j]) j=i; return j; } void sel_sort(int x[], int n) { int i, j; for(i=n; i>1; i--) { j=max(x,i); int temp=x[j]; x[j]=x[i-1]; x[i-1]=temp; } } void main() { int a[N], i; while(cin>...
a.cc:18:1: error: '::main' must return 'int' 18 | void main() | ^~~~
s564012088
p00001
C++
#include <iostream> using namespace std; int max(int x[], 10) { int i,j; j=0; for(i=1; i<n; i++) if(x[i]<x[j]) j=i; return j; } void sel_sort(int x[], 10) { int i, j; for(i=10; i>1; i--) { j=max(x,i); int temp=x[j]; x[j]=x[i-1]; x[i-1]=temp; } } void main() { int a[10], i; while(cin>>a[0]) { for(i=...
a.cc:3:18: error: expected identifier before numeric constant 3 | int max(int x[], 10) | ^~ a.cc:3:18: error: expected ',' or '...' before numeric constant a.cc: In function 'int max(int*, int)': a.cc:7:20: error: 'n' was not declared in this scope 7 | for(i=1; i<n; i++) | ...
s792095908
p00001
C++
#include <iostream> #include <conio.h> using namespace std ; int hills[10] ; int tops[3] = {0,0,0} ; int main() { for( int i = 0 ; i < 10 ; i ++ ) { cin >> hills[i] ; if( hills[i] >= tops[0] ) { tops[2] = tops[1] ; tops[1] = tops[0] ; tops[0] = hills[i] ; } else if( hills[i] >= tops[1] ) { ...
a.cc:2:10: fatal error: conio.h: No such file or directory 2 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s621059904
p00001
C++
a = Array.new 10.times do n = gets.to_i a.push n end a.sort! puts "#{a[9]} #{a[8]} #{a[7]}"
a.cc:1:1: error: 'a' does not name a type 1 | a = Array.new | ^
s485796987
p00001
C++
#include <iostream> #include <vector> using namespace std; int main() { vector<int> heights; for (int i = 0; i < 10; i++) { int height; cin >> height; heights.push_back(height); } sort(heights.rbegin(), heights.rend()); for (int i = 0; i < 3; i++) { cout << heights[i] << endl; } }
a.cc: In function 'int main()': a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(heights.rbegin(), heights.rend()); | ^~~~ | short
s522227461
p00001
C++
#include<iostream> #include<queue> using namespace std; int main() { priority_queue<int> que; for(int i=0;i<10;i++) { int t; cin>>t; que.push_pack(t); } for(int i=0;i<3;i++) { cout<<que.top()<<endl; que.pop(); } return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 'class std::priority_queue<int>' has no member named 'push_pack' 12 | que.push_pack(t); | ^~~~~~~~~
s242391231
p00001
C++
#include<iostream> #include<queue> using namespace std; int main() { priority_queue<int> que; for(int i=0;i<10;i++) { int t; cin>>t; que.push_back(t); } for(int i=0;i<3;i++) { cout<<que.top()<<endl; que.pop(); } return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 'class std::priority_queue<int>' has no member named 'push_back' 12 | que.push_back(t); | ^~~~~~~~~
s634238975
p00001
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ vector<int> a ; int x; for(int i=0;i<10;i++){ cin >> x a.push_back(x); } sort(a.begin() ,a.end(),greater<int>); for(int i=0;i<3;i++){ cout << a[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: expected ';' before 'a' 10 | cin >> x | ^ | ; 11 | a.push_back(x); | ~ a.cc:13:39: error: expected primary-expression before ')' token 13 | sort(a.begin() ,a.end(),greater<int>); | ...
s260018143
p00001
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ vector<int> a; int x; for(int i=0;i<10;i++){ cin >> x a.push_back(x); } sort(a.begin() ,a.end(),greater<int>()); for(int i=0;i<3;i++){ cout << a[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: expected ';' before 'a' 10 | cin >> x | ^ | ; 11 | a.push_back(x); | ~
s657034753
p00001
C++
#include<iostream> #include<string> using namespace std; int main_test() { string str; cout << "あなたの名前を入力してください" << endl; cin >> str; cout << str <<"さんよろ"<<endl; return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s501799232
p00001
C++
#include<stdio.h>#include<algorithm>int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
a.cc:1:18: warning: extra tokens at end of #include directive 1 | #include<stdio.h>#include<algorithm>int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;} | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../...
s410614513
p00001
C++
#include<stdio.h> #include<algorithm>int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
a.cc:1:19: warning: extra tokens at end of #include directive 1 | #include<stdio.h> #include<algorithm>int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;} | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../...
s787341194
p00001
C++
#include<stdio.h> #include<algorithm> int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
a.cc:1:19: warning: extra tokens at end of #include directive 1 | #include<stdio.h> #include<algorithm> int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;} | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/...
s323463710
p00001
C++
#include<stdio.h> #include<algorithm> using namespace std; int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
a.cc:1:19: warning: extra tokens at end of #include directive 1 | #include<stdio.h> #include<algorithm> using namespace std; int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;} | ^ /usr/bin/ld: /usr/lib/gcc...
s882564781
p00001
C++
#include<cstdio> #include<algorithm> using namespace std; int main(){ int a[10]; for(int i=0;i<10;i++) scanf("%d", &a[i]); sort(a[0],a[1]); for(int i=0;i<3;i++) printf("%d\n",a[i]); return 0; }
In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]': /usr/inclu...
s970503755
p00001
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a[10]; for(int i = 0; i < 10; i++) scanf("%d" &a[i]); for(int i = 0; i < 9; i++){ for(int j = i + 1; i < 10; i++){ if(a[i] > a[j]) swap(a[i], a[j]); } } for(int i = 0; i < 3; i++){ printf("%d\n", a[i]); } }
a.cc: In function 'int main()': a.cc:7:16: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&' 7 | scanf("%d" &a[i]); | ~~~~ ^~~~~ | | | | | int | const char [3]
s674322252
p00001
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a[10]; for(int i = 0; i < 10; i++) scanf("%d" &a[i]); for(int i = 0; i < 9; i++){ for(int j = i + 1; i < 10; i++){ if(a[i] > a[j]) swap(a[i], a[j]); } } for(int i = 0; i < 3; i++){ printf("%d\n", a[i]); } return 0...
a.cc: In function 'int main()': a.cc:7:16: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&' 7 | scanf("%d" &a[i]); | ~~~~ ^~~~~ | | | | | int | const char [3]
s045007709
p00001
C++
#include<iostream> #include<algorithm> using namespace std; itn data[10]; int main(){ for(int i=0;i<10;i++)cin>>data[i]; sort(data,data+10); for(int i=0;i<3;i++)cout<<data[i]<<endl; }
a.cc:4:1: error: 'itn' does not name a type; did you mean 'int'? 4 | itn data[10]; | ^~~ | int a.cc: In function 'int main()': a.cc:7:31: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 7 | for(int i=0;i<10;i++)cin>>data[i]; | ...
s624280471
p00001
C++
#include <iostream> using namespace std; int main(int argc, const char * argv[]) { int height[10]; for (int i=0; i<10; i++) { cin >> height[i]; } sort(height, height+10, greater<int>()); for (int i=0; i<3; i++) { cout << height[i] << endl; } return 0; }
a.cc: In function 'int main(int, const char**)': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(height, height+10, greater<int>()); | ^~~~ | short
s815170356
p00001
C++
#include<iostream> using namespace std; int main(){ int top3Mountain[3]; memset(top3Mountain, 0, sizeof(top3Mountain)); for (int i=0; i<10; i++) { int newHeight = 0; scanf("%d", &newHeight); if (top3Mountain[0] < newHeight) { top3Mountain[2] = top3Mountain[...
a.cc: In function 'int main()': a.cc:6:5: error: 'memset' was not declared in this scope 6 | memset(top3Mountain, 0, sizeof(top3Mountain)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#in...
s309435968
p00001
C++
#include<iostream> #include<cmath> #include<string> #include<cctype> #include<vector> using namespace std; int main(){ vector<int>ar(10); for(auto&e:ar){ scanf("%d",&e); } sort(ar.begin(),ar.end()); printf("%d\n%d\n%d\n",ar[9],ar[8],ar[7]); return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 12 | sort(ar.begin(),ar.end()); | ^~~~ | sqrt
s313872051
p00001
C++
#include<iostream> using namespace std; int main() { int d[10],i,j,tmp; for(i=0;i<10;i++) cin >> d[10]; for(i=0;i<9;i++) { for(l=i+1;j<10;j++) { if(d[i]<d[j]) { tmp=d[i]; d[i]=d[j]; d[j]=tmp; ...
a.cc: In function 'int main()': a.cc:10:13: error: 'l' was not declared in this scope 10 | for(l=i+1;j<10;j++) | ^
s279340395
p00001
C++
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #include<iostream> using namespace std; int main() { int d[10],i,j,tmp; for(i=0;i<10;i++) cin >> d[10]; for(i=0;i<9;i++) { for(j=i+1;j<10;j++) { if(d[i]<d[j]) { tmp=d[i...
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 2 | ^ 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...
s773630539
p00001
C++
#include<iostream> #include<algorithm> int main(){ int a[10]; for(int i=0;i<10;i++)cin>>a[i]; sort(a,a+10); for(int i=0;i<3;i++)cout<<a[i]<<endl; }
a.cc: In function 'int main()': a.cc:5:30: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | for(int i=0;i<10;i++)cin>>a[i]; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: ...
s105047152
p00001
C++
#include<stdio.h> int main(void){ int i; int a[10]; int x=0, y=0, z=0; for(i=0;i<10;i++){ do{ printf("山の高さ%d(整数)",i+1); scanf("%d",&a[i]); }while(a[i]<0||10000<a[i]) if(a[i]>x){ z=y; y=x; x=a[i]; } else if(a[i]>y){ z=y; y=a[i]; } else if(a[i]>z){ z=a[i]; } } printf("...
a.cc: In function 'int main()': a.cc:11:43: error: expected ';' before 'if' 11 | }while(a[i]<0||10000<a[i]) | ^ | ; 12 | 13 | if(a[i]>x){ | ~~ ...