submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s071815771
p00018
C++
#include <iostream> #include <cstdlib> using namespace std; namespace sorting_five_numbers { class SortingFiveNumbers { private: //! データサイズ static const int Size = 5; //! 入力値 int dataList[Size]; public: /** * @brief コンストラクタ */ SortingFi...
a.cc: In constructor 'sorting_five_numbers::SortingFiveNumbers::SortingFiveNumbers(int*)': a.cc:22:13: error: 'memset' was not declared in this scope 22 | memset(dataList, 0, Size); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#...
s238950955
p00018
C++
require 'set' class PriorityQueue < SortedSet @@id = 0 def << obj add obj end def add obj super([obj,@@id]) @@id+=1 end def at idx super idx end def top self.min[0] end def pop self.delete(self.min) end end s = PriorityQueue.new input = gets.split(' ').map(&:to_i) ...
a.cc:1:9: warning: multi-character character constant [-Wmultichar] 1 | require 'set' | ^~~~~ a.cc:4:3: error: stray '@' in program 4 | @@id = 0 | ^ a.cc:4:4: error: stray '@' in program 4 | @@id = 0 | ^ a.cc:11:16: error: stray '@' in program 11 | super([obj,@@id])...
s517114235
p00018
C++
#include <cstdio> #include <algorithm> #define SWAP(a,b) { a += b, b = a - b, a -= b; } using namespace std; int main() { int n[5]; for(int i=0;i<5;++i) scanf("%d",&n[i]); sort(n,n+5); for(int i=0;i<2;++i) { SWAP(n[i],n[4-i]); } for(int i=0;i<4;++i) printf("%d ",n[i]); printf("%d\n",n[4]); ...
a.cc: In function 'int main()': a.cc:14:13: error: expected ';' before '}' token 14 | return 0 | ^ | ; 15 | } | ~
s107145610
p00018
C++
#include <iostream> #include <vector> #include <stack> #include <queue> #include <map> #include <set> #include <string> #include <math.h> typedef long long Int; #define REP(i,n) for(int i = 0 ; i < n ; ++i) using namespace std; int main(){ int n = 5; vector<int> aa; REP(i, n){ int a; cin >> a; aa.push_back...
a.cc: In function 'int main()': a.cc:25:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 25 | sort(aa.begin(), aa.end()); | ^~~~ | sqrt
s299386243
p00018
C++
#include<cstdio> #include<algorithm> using namespace std; int main(){ int a[5],i,j,min,min_n; for(i=0:i<5;i++) scanf("%d",&a[i]); for(i=0;i<5;i++){ min=a[i]; min_n=i; for(j=i+1;j<5;j++){ if(min>a[j]){ min=a[j]; min_n=j; } swap(a[i],a[min]); printf( i<4 ? "%d " : "%d\n",...
a.cc: In function 'int main()': a.cc:9:10: error: expected ';' before ':' token 9 | for(i=0:i<5;i++) | ^ | ; a.cc:9:18: error: expected ';' before ')' token 9 | for(i=0:i<5;i++) | ^ | ; a.cc:23:2: error: expected '}' at end of input...
s402640207
p00018
C++
#include<cstdio> #include<algorithm> using namespace std; int main(){ int a[5],i,j,min,min_n; for(i=0:i<5;i++) scanf("%d",&a[i]); for(i=0;i<5;i++){ min=a[i]; min_n=i; for(j=i+1;j<5;j++){ if(min>a[j]){ min=a[j]; min_n=j; } } swap(a[i],a[min]); printf( i<4 ? "%d " : "%d\n...
a.cc: In function 'int main()': a.cc:9:10: error: expected ';' before ':' token 9 | for(i=0:i<5;i++) | ^ | ; a.cc:9:18: error: expected ';' before ')' token 9 | for(i=0:i<5;i++) | ^ | ;
s406854928
p00018
C++
#include<cstdio> #include<algorithm> using namespace std; int main(){ int a[5],i,j,min,min_n; for(i=0:i<5;i++) scanf("%d",&a[i]); for(i=0;i<5;i++){ min=a[i]; min_n=i; for(j=i+1;j<5;j++){ if(min<a[j]){ min=a[j]; min_n=j; } } swap(a[i],a[min]); printf( i<4 ? "%d " : "%d\n...
a.cc: In function 'int main()': a.cc:9:10: error: expected ';' before ':' token 9 | for(i=0:i<5;i++) | ^ | ; a.cc:9:18: error: expected ';' before ')' token 9 | for(i=0:i<5;i++) | ^ | ;
s493814755
p00018
C++
#include<iostream> #include<algorithm> int main(){ int a[5]; for(int i=0;i<5;++i){ std::cin>>a[i]; } std::sort(a,a+5,greater<int>()); for(int i=0;i<5;++i){ std::cout<<a[i]<<' '; } return 0; }
a.cc: In function 'int main()': a.cc:8:25: error: 'greater' was not declared in this scope; did you mean 'std::greater'? 8 | std::sort(a,a+5,greater<int>()); | ^~~~~~~ | std::greater In file included from /usr/include/c++/14/string:49, ...
s683091350
p00018
C++
#include <vector> #Include <algorithm> #include <cstdio> using namespace std; int main(){ vector<int> v(5); for(int i = 0; i < 5; i++){ scanf("%d",&v[i]); } sort(v.rbegin(), v.rend()); for(int i = 0; i < 5; i++){ printf("%d ", v[i]); } printf("\n"); return 0; }
a.cc:2:2: error: invalid preprocessing directive #Include; did you mean #include? 2 | #Include <algorithm> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(v.rbegin(), v.rend()); | ^~~~...
s844311441
p00018
C++
#include<stdio.h> int main() { int n[6]={},x; for(int i=0;i<5;i++) scanf("%d ",&x); for(int i=0;i<5;i++) for(int j=4;j<i;j++) if(n[j]>n[j-1]){int t=n[j-1];n[j-1]=n[j];n[j]=t} for(int i=0;i<5;i++) {if(i>0)printf(" "); printf("%d",n[i]);} return 0; }
a.cc: In function 'int main()': a.cc:10:48: error: expected ';' before '}' token 10 | if(n[j]>n[j-1]){int t=n[j-1];n[j-1]=n[j];n[j]=t} | ^ | ;
s873191553
p00018
C++
#include<istream> using namespace std int main () { int i,j,s,w,a[5]; for(i=0;i<5;i++) cin >> a[i]; for(j=0;j<5;j++) { s = a[0]; for(i=1;i<5;i++) { if(s > a[i]) {w = a[i]; a[i] = s; s = w;} } } for(i=0;i<5;i++) { cout << a[i] if(i!=4) cout <...
a.cc:2:20: error: expected ';' before 'int' 2 | using namespace std | ^ | ; 3 | 4 | int main () { | ~~~ a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin >> a[i]; | ^~~ a.c...
s691616832
p00018
C++
#include<iostream> using namespace std int main () { int i,j,s,w,a[5]; for(i=0;i<5;i++) cin >> a[i]; for(j=0;j<5;j++) { s = a[0]; for(i=1;i<5;i++) { if(s > a[i]) {w = a[i]; a[i] = s; s = w;} } } for(i=0;i<5;i++) { cout << a[i]; if(i!=4) cout...
a.cc:2:20: error: expected ';' before 'int' 2 | using namespace std | ^ | ; 3 | 4 | int main () { | ~~~
s046853322
p00018
C++
#include<iostream> using namespace std; int main () { int i,j,s,w,a[5]; for(i=0;i<5;i++) cin >> a[i]; t = 0; for(j=0;j<5;j++) { s = a[0]; for(i=1;i<5;i++) { if(s > a[i]) {w = a[i]; a[i] = s; s = w;a[t] = s;t = i;} } } for(i=0;i<5;i++) { cout << ...
a.cc: In function 'int main()': a.cc:8:5: error: 't' was not declared in this scope 8 | t = 0; | ^
s522069762
p00018
C++
#include<iostream> using namespace std; int main(){ int a,b,c,d,e; cin >> a >> b >> c >> d >> e; int r = 0; if(a < b){ r = a; a = b; b = r; } if(a < c){ r = a; a = c; c = r; } if(a < d){ r = a; a = d; d = r; } if(a < e){ r = a; a = e; e = r; } if(b < c){ r = b; b = c; c = r; } if(b < d){ r = b; b = d; d = r; } if(b ...
a.cc: In function 'int main()': a.cc:60:6: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 60 | cout >> a >> b >> c >> d >> e >> endl; | ~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:60:6: ...
s919591831
p00018
C++
#include<iostream> using namespace std; int main() { int a, b, c, d, e, a[6], i, j; cin >> a >> b >> c >> d >> e; a[0] = a; a[1] = b; a[2] = c; a[3] = d; a[4] = e; for ( j = 0;j < 5; j++) { for ( i = 0;i < 5; i++) { if (a[i] >= a[i + 1])a[i + 1] = a[i]; } } cout << a[0] << " " <<a[1] << " " << a[2] <<...
a.cc: In function 'int main()': a.cc:5:28: error: conflicting declaration 'int a [6]' 5 | int a, b, c, d, e, a[6], i, j; | ^ a.cc:5:13: note: previous declaration as 'int a' 5 | int a, b, c, d, e, a[6], i, j; | ^ a.cc:7:10: error: invalid types ...
s181876619
p00018
C++
#include<iostream> using namespace std; int main() { int a, b, c, d, e, a[6], i, j; cin >> a >> b >> c >> d >> e; a[0] = a; a[1] = b; a[2] = c; a[3] = d; a[4] = e; for ( j = 0;j < 5; j++) { for ( i = 0;i < 5; i++) { if (a[i] >= a[i + 1])a[i + 1] = a[i]; } } cout << a[0] << " " <<a[1] << " " << a[2] <...
a.cc: In function 'int main()': a.cc:6:28: error: conflicting declaration 'int a [6]' 6 | int a, b, c, d, e, a[6], i, j; | ^ a.cc:6:13: note: previous declaration as 'int a' 6 | int a, b, c, d, e, a[6], i, j; | ^ a.cc:8:10: error: invalid types ...
s417549309
p00018
C++
#include<iostream> using namespace std; int main(){ int num[5]; int M1 = 0, M2 = 0, M3= 0 , M4= 0 , M5 = 0; int I1 = 0, I2 = 0, I3= 0 , I4= 0 , I5 = 0 ; cin >> num[0] >> num[1] >> num[2] >> num[3] >> num[4] ; for(int i=0 ; i < 5; i++){ if(M1 < nim[i]) { M1 = num[i]; I1 = i; } } for(int i=0 ; i < 5; i++){ if(i == I1 ...
a.cc: In function 'int main()': a.cc:11:9: error: 'nim' was not declared in this scope; did you mean 'num'? 11 | if(M1 < nim[i]) { | ^~~ | num a.cc:19:9: error: 'nim' was not declared in this scope; did you mean 'num'? 19 | if(M2 < nim[i]) { | ^~~ | num a.cc...
s508267186
p00018
C++
#include<iostream> using namespace std; int main(){ int num[5]; int M1 = 0, M2 = 0, M3= 0 , M4= 0 , M5 = 0; int I1 = 0, I2 = 0, I3= 0 , I4= 0 , I5 = 0 ; cin >> num[0] >> num[1] >> num[2] >> num[3] >> num[4] ; for(int i=0 ; i < 5; i++){ if(M1 < nim[i]) { M1 = num[i]; I1 = i; ...
a.cc: In function 'int main()': a.cc:11:15: error: 'nim' was not declared in this scope; did you mean 'num'? 11 | if(M1 < nim[i]) { | ^~~ | num a.cc:19:17: error: 'nim' was not declared in this scope; did you mean 'num'? 19 | if(M2 < nim[i]) { | ...
s795654917
p00018
C++
#include<iostream> using namespace std; int main(){ int num[5]; int M1 = 0, M2 = 0, M3= 0 , M4= 0 , M5 = 0; int I1 = 0, I2 = 0, I3= 0 , I4= 0 , I5 = 0 ; cin >> num[0] >> num[1] >> num[2] >> num[3] >> num[4] ; for(int i=0 ; i < 5; i++){ if(M1 < nim[i]) { M1 = num[i]; I1 = i; ...
a.cc: In function 'int main()': a.cc:11:15: error: 'nim' was not declared in this scope; did you mean 'num'? 11 | if(M1 < nim[i]) { | ^~~ | num a.cc:19:17: error: 'nim' was not declared in this scope; did you mean 'num'? 19 | if(M2 < nim[i]) { | ...
s116764121
p00018
C++
puts gets.split.map(&:to_i).sort * " "
a.cc:1:1: error: 'puts' does not name a type 1 | puts gets.split.map(&:to_i).sort * " " | ^~~~
s884066710
p00018
C++
puts gets.split.map(&:to_i).sort.reverse * " "
a.cc:1:1: error: 'puts' does not name a type 1 | puts gets.split.map(&:to_i).sort.reverse * " " | ^~~~
s204126763
p00018
C++
import std.stdio; import std.string; import std.math; import std.conv; import std.algorithm; import std.bigint; int[] a; void main(){ auto s = split(readln()); int temp; for(int i=0;i<5;i++){ a ~= to!int(s[i]);; } sort!("a > b")(a); writef("%d %d %d %d %d\n",a[0],a[1],a[2],a[3],a[4]); }
a.cc:1:1: error: 'import' does not name a type 1 | import std.stdio; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import std.string; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: e...
s987395268
p00018
C++
#include<iostream> using namespace std; int main(){ int a[10]={},b=0; for(int i=0;i<5;i++) cin>>a[i]; for(int j=0;j<5;j++) for(int i=1;i<5;i++) if(a[i-1]<a[i]) swap(a[i-1],a[i]); for(int i=0;i<5;i++) cout<<a[i]<<' '; cout<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:7: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 13 | cout<endl; | ~~~~^~~~~ In file included from /usr/include/c++/14/string:48, from /usr/include/c++/...
s085760747
p00018
C++
#include<iostream> using namespace std; int main(){ int a[10]={},b=0; for(int i=0;i<5;i++) cin>>a[i]; for(int j=0;j<5;j++) for(int i=1;i<5;i++) if(a[i-1]<a[i]) swap(a[i-1],a[i]); for(int i=0;i<5;i++) cout<<a[i]<<' '; cout<endl; return 0; }
a.cc: In function 'int main()': a.cc:13:7: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 13 | cout<endl; | ~~~~^~~~~ In file included from /usr/include/c++/14/string:48, from /usr/include/c++/...
s322435274
p00018
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef complex<double> P; typedef pair<int,int> pii; #define REP(i,n) for(ll i=0;i<n;++i) #define REPR(i,n) for(ll i=1;i<n;++i) #define FOR(i,a,b) for(ll i=a;i<b;++i) #define DEBUG(x) cout<<#x<<": "<<x...
a.cc: In function 'int main()': a.cc:28:11: error: no match for 'operator+' (operand types are 'vi' {aka 'std::vector<int>'} and 'int') 28 | sort(a,a+5); | ~^~ | | | | | int | vi {aka std::vector<int>} In file included from /usr/include/c++/14/bits/stl_al...
s006978039
p00018
C++
#include <iostream> using namespace std; int main(){ int a[5]; for(int i=0; i<5; i++){ cin >> a[i]; } sort(a, a+3); for(int m=4; 0<=m; m--){ cout << a[m] << " " << endl; } }
a.cc: In function 'int main()': a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a, a+3); | ^~~~ | short
s660262215
p00018
C++
#include <iomanip> #include <string> #include <stack> using namespace std; int main(){ priority_queue<int> q; for (int i = 0; i < 5; ++i) { int a; cin >> a; q.push(a); } for (int i = 0; i < 5; ++i) { cout << q.top(); if (i != 4) cout << ' '; q.pop(); } return 0; }
a.cc: In function 'int main()': a.cc:7:9: error: 'priority_queue' was not declared in this scope 7 | priority_queue<int> q; | ^~~~~~~~~~~~~~ a.cc:4:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>' 3 | #include <stack> ++...
s591651856
p00018
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int a, b, c, d, e; vector<int> v; v.push_back(a); v.push_back(b); v.push_back(c); v.push_back(d); v.push_back(e); sort(v.begin(), v.end(), greater<int>); for (int i = 0; i < v.size(); ++i) { cout << v[i]; if (i < v.size...
a.cc: In function 'int main()': a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<int> v; | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <algorithm> +++ |+#include <vector> 3 | using na...
s110249981
p00018
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int a, b, c, d, e; vector<int> v; scanf("%d %d %d %d %d", &a, &b, &c, &d, &e); v.push_back(a); v.push_back(b); v.push_back(c); v.push_back(d); v.push_back(e); sort(v.begin(), v.end(), greater<int>); for (int i = 0; i < v.size...
a.cc: In function 'int main()': a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<int> v; | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <algorithm> +++ |+#include <vector> 3 | using na...
s489743627
p00018
C++
#include<iostream> #include<queue> #include<string> #include<stack> #include<cstdio> #include<algorithm> using namespace std; int main(void) { int a[5]; cin<<a[0]<<a[1]<<a[2]<<a[3]<<a[4]; sort(a,a+5); printf("%d %d %d %d %d", a[0],a[1],a[2],a[3],a[4]); }
a.cc: In function 'int main()': a.cc:14:6: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 14 | cin<<a[0]<<a[1]<<a[2]<<a[3]<<a[4]; | ~~~^~~~~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:...
s281644500
p00018
C++
#include <iostream> using namespace std; int main(void){ // Here your code ! int a[5]; for(int i=0;i<5;i++){ cin>>a[i]; } sort(a,a+5); for(int i=4;i>0;i--){ cout<<a[i]<<" "; } cout<<a[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(a,a+5); | ^~~~ | short
s557893062
p00018
C++
#include <iostream> using namespace std; int main(void){ // Here your code ! int a[5]; for(int i=0;i<5;i++){ cin>>a[i]; } sort(a,a+5); for(int i=4;i>0;i--){ cout<<a[i]<<" "; } cout<<a[0]<<endl; }
a.cc: In function 'int main()': a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a,a+5); | ^~~~ | short
s092518921
p00018
C++
??? #include <iostream> using namespace std; int main(){ int number[6] , i , j , ans[6] ; for( i=1 ; i<=5 ; i++ ) cin >> number[i] ; for( i=1 ; i<=5 ; i++ ){ for( j=i ; j<=5 ; j++ ){ if( number[i] < number[j] ) swap( number[i] , number[j] ); } ans[i] = number[i]; cout << ans[i] <<" "; } }
a.cc:1:5: error: stray '#' in program 1 | ??? #include <iostream> | ^ a.cc:1:1: error: expected unqualified-id before '?' token 1 | ??? #include <iostream> | ^ a.cc: In function 'int main()': a.cc:6:17: error: 'cin' was not declared in this scope 6 | cin >> number[i] ; ...
s416085547
p00018
C++
??? #include <iostream> using namespace std; int main(){ int number[6] , i , j , ans[6] ; for( i=1 ; i<=5 ; i++ ) cin >> number[i] ; for( i=1 ; i<=5 ; i++ ){ for( j=i ; j<=5 ; j++ ){ if( number[i] < number[j] ) swap( number[i] , number[j] ); } ans[i] = number[i]; cout << ans[i] <<" "; } }
a.cc:1:5: error: stray '#' in program 1 | ??? #include <iostream> | ^ a.cc:1:1: error: expected unqualified-id before '?' token 1 | ??? #include <iostream> | ^ a.cc: In function 'int main()': a.cc:6:17: error: 'cin' was not declared in this scope 6 | cin >> number[i] ; ...
s400231165
p00018
C++
#include<iostream> #include<algorithm> #define FOR(i,n) for(int i = 0; i < n; i++) using namespace std; int main(){ int num[5]; FOR(i,5) cin >> num[i]; sort(num,num+5); FOR(i,5) cout >> num[i]; }
a.cc: In function 'int main()': a.cc:9:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 9 | FOR(i,5) cout >> num[i]; | ~~~~ ^~ ~~~~~~ | | | | | int | std::ost...
s908806935
p00018
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int num[5]; for(int i = 0; i = 4; i++) cin >> num[i]; sort(num,num+5); for(int i = 4; i = 0; i--) cout >> num[i] >> " " >> endl; }
a.cc: In function 'int main()': a.cc:10:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 10 | cout >> num[i] >> " " >> endl; | ~~~~ ^~ ~~~~~~ | | | | | int | std::ostream {aka std::basi...
s521169112
p00018
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int num[5]; for(int i = 0; i < 5; i++) cin >> num[i]; sort(num, num + 5, greater<int>()); for(int i = 0; i < 5; i++) cout << num[i] << ((i!=4)?'':'\n'); }
a.cc:13:31: error: empty character constant 13 | cout << num[i] << ((i!=4)?'':'\n'); | ^~
s512233094
p00018
C++
#include<iostream> #include<algorithm> #define REP(i,n) for(int i = 0; i < n; i++) using namespace std; int main(){ int in[5]; REP(i,5) cin >> in[i]; sort(in.begin(), in.end(), greater<int>()); REP(i,4) cout << in[i] << " "; cout << in[4] << "\n"; }
a.cc: In function 'int main()': a.cc:8:11: error: request for member 'begin' in 'in', which is of non-class type 'int [5]' 8 | sort(in.begin(), in.end(), greater<int>()); | ^~~~~ a.cc:8:23: error: request for member 'end' in 'in', which is of non-class type 'int [5]' 8 | sort(in.begin(), in....
s761970324
p00018
C++
#include <iostream> #include<math.h> using namespace std; int main() { int num[5]; for(int i=0; i<5; i++) { cin>>num[i]; } sort(num,num+5); for(int s=4; s>=0; s--) { cout<<num[s]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 10 | sort(num,num+5); | ^~~~ | sqrt
s981724472
p00018
C++
#include <iostream> #include<math.h> using namespace std; int main() { int num[5]; for(int i=0; i<5; i++) { cin>>num[i]; } sort(num,num+5); for(int s=4; s>=0; s--) { cout<<num[s]<<" "; } return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 10 | sort(num,num+5); | ^~~~ | sqrt
s930544048
p00018
C++
<?php // Here your code ! $inputs = trim(fgets(STDIN)); $values = explode(' ', $inputs); rsort($values); foreach ($values as $value) { echo $value . ' '; } ?>
a.cc:1:1: error: expected unqualified-id before '<' token 1 | <?php | ^ a.cc:4:1: error: '$values' does not name a type 4 | $values = explode(' ', $inputs); | ^~~~~~~ a.cc:5:6: error: expected constructor, destructor, or type conversion before '(' token 5 | rsort($values); | ^ a.cc:7:...
s367603961
p00018
C++
#include<iostream> #include<vector> using namespace std; int main() { int a,i,j,change; for(int k=0;k<5;k++){ cin>>a; s.push_back(a); } for (i = 0; i < 4; i++) { for (j = 0; j < 4-i; j++) { if (s[j] < s[j + 1]) { change = s[j]; s[j] = s[j+1]; s[j+1] = change; } }...
a.cc: In function 'int main()': a.cc:8:13: error: 's' was not declared in this scope 8 | s.push_back(a); | ^ a.cc:12:29: error: 's' was not declared in this scope 12 | if (s[j] < s[j + 1]) { | ^ a.cc:19:17: error: 's' was not...
s351965857
p00018
C++
#include <iostream> #include <vector> #define FOR(var, start, end) for(var = start; var < end; ++var) #define WHILE(var, end) while(var != end) #define SHOW_ALL(a, b, c) cout << a << endl; \ cout << b << endl; \ cout << c << endl; using namespace ...
a.cc: In function 'int main()': a.cc:43:105: error: expected ';' before '}' token 43 | printf("%d %d %d %d %d", input_array[0],input_array[1],input_array[2],input_array[3],input_array[4]) | ^ | ...
s302408795
p00018
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n[5]; for (int i = 0; i < 5; i++) { cin >> n[i]; } sort(n, n + 5); for (int i = 4; i >= 0; i--) { cout << n[i], << endl;; } }
a.cc: In function 'int main()': a.cc:13:19: error: expected primary-expression before '<<' token 13 | cout << n[i], << endl;; | ^~
s697063048
p00018
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n[5]; for (int i = 0; i < 5; i++) { cin >> n[i]; } sort(n, n + 5); for (int i = 4; i >= 0; i--) { cout << n[i], << endl; } }
a.cc: In function 'int main()': a.cc:13:19: error: expected primary-expression before '<<' token 13 | cout << n[i], << endl; | ^~
s285824456
p00018
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a[5]; for( int s = 0; s < 5; s++){ cin >> a[s] } sort( a, a + 5, greater<int>()); for(int i = 0; i < 5; i++){ cout << a[i]; } return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: expected ';' before '}' token 6 | cin >> a[s] | ^ | ; 7 | } | ~
s404553811
p00018
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a[5]; for( int s = 0; s < 5; s++){ cin >> a[s] } sort( a, a + 5, greater<int>()); for(int i = 0; i < 5; i++){ cout << a[i] << " "; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: expected ';' before '}' token 6 | cin >> a[s] | ^ | ; 7 | } | ~
s985148471
p00018
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a[5]; for( i = 0; i < 5; i++){ cin >> a[i]; } sort( a, a + 5, greater<int>()); for(int s = 0; s < 5; s++){ cout << a[s] << " "; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:6: error: 'i' was not declared in this scope 5 | for( i = 0; i < 5; i++){ | ^
s901546748
p00018
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a[5]; for(int S = 0; S < 5; S++){ cin >> a[S]; } sort(a, a + 5, greater<int>()); for(int i = 0; i < 5; i++){ if(i == 4){ cout << a[i]; } else cout << arr[i] << " "; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:30: error: 'arr' was not declared in this scope 14 | else cout << arr[i] << " "; | ^~~
s200814183
p00018
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b[9],c[9],d[9],f[9]; string n[9]; while(1){ cin >> a >> endl; if(a == 0)break; for(int i = 0 ; i < a ; i++){ cin >> n[i] >> b[i] >> c[i] >> d[i]; f[i] = b[i]*3 + c[i]*0 + d[i]*1; } sort(f.begin(), f + a.end()){ for(int j = 0 ; j < a ;...
a.cc: In function 'int main()': a.cc:8:26: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 8 | cin >> a >> endl; | ~~~~~~~~~^~~~~~~ In file included from...
s292827636
p00018
C++
#include<bits/stdc++.h>; using namespace std; int main(){ int a[5]; for( s = 0; s < 5; s++){ cin >> a[s]; } sort( a, a + 5, greater<int>()); for(int i = 0; i < 5; i++){ if( i < 4 ){ cout << a[i] << " "; }else{ cout << a[i] << endl; } return 0; }
a.cc:1:24: warning: extra tokens at end of #include directive 1 | #include<bits/stdc++.h>; | ^ a.cc: In function 'int main()': a.cc:5:6: error: 's' was not declared in this scope 5 | for( s = 0; s < 5; s++){ | ^ a.cc:16:2: error: expected '}' at end of input 16 | } ...
s026557097
p00018
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a[5]; for(int i = 0; i < 5; i++){ cin >> a[i]; } sort(a, a + 5, greater<int>()); for(int i = 0; i < 5; i++){ if(i == 4){ cout << a[i]; } else cout << arr[i] << " "; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:30: error: 'arr' was not declared in this scope 14 | else cout << arr[i] << " "; | ^~~
s886092116
p00018
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; typedef long long ll; int main(){ vector<int> vc; int x; for(int i=0;i<5;i++){ cin >> x; vc.push_back(x); } rsort(vc.begin(),vc.end()); for(int i=0;i<vc.size();i++){ cout << vc[i] << " "; } ...
a.cc: In function 'int main()': a.cc:13:5: error: 'rsort' was not declared in this scope; did you mean 'qsort'? 13 | rsort(vc.begin(),vc.end()); | ^~~~~ | qsort
s478154685
p00018
C++
#include<bits/stdc++.h> using namespace std; int main() { int a[5]; for(int i=0;i<5;i++) cin>>a[i]; sort(a,a+5); reverse(a,a+b); for(int i=0;i<5;i++){ if(i) cout<<" "; cout<<a[i]; } }
a.cc: In function 'int main()': a.cc:8:13: error: 'b' was not declared in this scope 8 | reverse(a,a+b); | ^
s172770798
p00018
C++
#include <stdio.h> int main(void) { int a[5], i, j, t; for(i = 0; i < n; ++i) scanf("%d", &a[i]); for(i = 0; i < n; ++i) for(j = i + 1; j < n; ++j) if(a[i] < a[j]) t = a[i], a[i] = a[j], a[j] = t; for(i = 0; i < 4; ++i) printf("%d ", a[i]); printf("%d\n", a[4]); return 0; }
a.cc: In function 'int main()': a.cc:5:18: error: 'n' was not declared in this scope 5 | for(i = 0; i < n; ++i) scanf("%d", &a[i]); | ^ a.cc:6:18: error: 'n' was not declared in this scope 6 | for(i = 0; i < n; ++i) for(j = i + 1; j < n; ++j) if(a[i] < a[j]) t = a[i], a[i] = a[j], a[j...
s617303248
p00018
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int n=0; vector<int> v; for(int i=0;i<5;i++) { cin>>n; v.push_back(n); } sort(v.begin(),v.end()); reverse(v.begin(),v.end()); for(int i=0;i<5;i++){ cout<<v[i]; if(i!=4) cout<<endl; cout<<endl; r...
a.cc: In function 'int main()': a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s848724332
p00018
C++
#include <stdio.h> void main () { int number[5]; int i,j,a,n; for (i =0;i<5;++i) scanf("%d",&number[i]); for (i=0; i<3;++i) { for (j=i+1; j<4;++j) { if (number[i]<number[j]) { a=number[i]; ...
a.cc:2:5: error: '::main' must return 'int' 2 | void main () | ^~~~
s034186946
p00018
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int a[5]; for(int i=0;i<5;i++){ cin>>a[i]; } sort(a,a+5); reverse(t,t+5); cout<<a[0]; for(int j=1;j>=5;j++){ cout<<" "<<a[j]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 't' was not declared in this scope 10 | reverse(t,t+5); | ^
s989325448
p00018
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int a[5]; for(int i=0;i<5;i++){ cin>>a[i]; } sort(a,a+5); reverse(t,t+5); cout<<a[0]; for(int j=1;j<=5;j++){ cout<<" "<<a[j]; } cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 't' was not declared in this scope 10 | reverse(t,t+5); | ^
s579345792
p00018
C++
#include<iostream> int main() { int n[5]; for (int i = 0; i < 5; i++) { std::cin >> n[i]; } for (int i = 0; i < 5; i++) { int max = INT_MIN, max_index = 0; for (int j = i; j < 5; j++) { if (max < n[j]) { max = n[j]; max_index = j; } } std::swap(n[i], n[max_index]); } for (int i = 0;...
a.cc: In function 'int main()': a.cc:11:27: error: 'INT_MIN' was not declared in this scope 11 | int max = INT_MIN, max_index = 0; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #inc...
s088179517
p00018
C++
#include<numeric> #include<iostream> using namespace std; int main() { int a[5]; for(int i=0;i<5;i++) cin>>a[i]; sort(a,a+5,greater<int>()); for(int i=0;i<5;i++) cout<<(i?" ":"")<<a[i]; cout<<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(a,a+5,greater<int>()); | ^~~~ | short
s134581998
p00018
C++
a[],i,j;main(){while(~scanf("%d",a+i))qsort(a,++i,4,"YXZRPQ\213\0+\x2\303");for(;i--;)j=!printf(i?"%d ":"%d\n",a[i]);}
a.cc:1:1: error: 'a' does not name a type 1 | a[],i,j;main(){while(~scanf("%d",a+i))qsort(a,++i,4,"YXZRPQ\213\0+\x2\303");for(;i--;)j=!printf(i?"%d ":"%d\n",a[i]);} | ^ a.cc:1:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | a[],i,j;main(){while(~scanf("%d",a+i))qsort(a,+...
s659339692
p00018
C++
a[5],i,j;main(){for(;j=~scanf("%s",i+a)||i+!!printf(i--?"%s ":"%s\n",a+--i);qsort(a,++i,4,"YXZRPQ\213\0+\x2\303"));}
a.cc:1:1: error: 'a' does not name a type 1 | a[5],i,j;main(){for(;j=~scanf("%s",i+a)||i+!!printf(i--?"%s ":"%s\n",a+--i);qsort(a,++i,4,"YXZRPQ\213\0+\x2\303"));} | ^ a.cc:1:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | a[5],i,j;main(){for(;j=~scanf("%s",i+a)||i+!!pri...
s740657025
p00018
C++
*a=&a;main(i){*a=~scanf("%d",++a)?!printf(i?"%d\n":"%d ",*--a,main(0)):qsort(a-5,5,4,"YXZRPQ?+\2\303");}
a.cc:1:3: error: expected constructor, destructor, or type conversion before '=' token 1 | *a=&a;main(i){*a=~scanf("%d",++a)?!printf(i?"%d\n":"%d ",*--a,main(0)):qsort(a-5,5,4,"YXZRPQ?+\2\303");} | ^ a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token 1 | *a=&a;main(i...
s173209903
p00018
C++
*a=&a;main(i){*a=~scanf("%d",++a)?!printf(i?"%d\n":"%d ",*--a,main(0)):qsort(a-5,5,4,"YXZRPQ\213\0+\2テδ。");}
a.cc:1:3: error: expected constructor, destructor, or type conversion before '=' token 1 | *a=&a;main(i){*a=~scanf("%d",++a)?!printf(i?"%d\n":"%d ",*--a,main(0)):qsort(a-5,5,4,"YXZRPQ\213\0+\2テδ。");} | ^ a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token 1 | *a=&a;ma...
s802177416
p00018
C++
import java.util.*; public class Main { void run() { Scanner sc = new Scanner(System.in); int[] num = new int [5]; for (int i=0;i<5;i++) { num[i] = sc.nextInt(); } Arrays.sort(num); for (int i=num.length-1;i>=0;i--) { System.out.print(num[i]); if (i != 0)System.out.print(" "); else Syste...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s196938577
p00018
C++
#include <iostream> #include <vector> #include <cstdio> using namespace std; int main() { vector<int> num(5); cin >> num[0] >> num[1] >> num[2] >> num[3] >> num[4]; sort(num.begin(), num.end()); printf("%d %d %d %d %d\n", num[0],num[1],num[2],num[3],num[4]); 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(num.begin(), num.end()); | ^~~~ | short
s191501498
p00018
C++
include <iostream> #include <vector> #include <algorithm> #include <functional> using namespace std; int main() { vector<int> in(5); for (int i = 0; i < 5; ++i) cin >> in[i]; sort(in.begin(), in.end(), greater<int>()); cout << in[0]; for (int i = 1; i < in.size(); ++i) cout << " " << in[i]; cout ...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu...
s643890967
p00018
C++
#include <iostream> using namespace std; int main() { int a[5]; for(int i=0;i<5;i++) cin >> a[i]; sort(a, a+5); cout << a[4]; for(int i = 3; i>=0; i-- ) cout << " " << a[i]; cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'sort' was not declared in this scope; did you mean 'short'? 6 | sort(a, a+5); | ^~~~ | short
s828207046
p00018
C++
#include <iostream> #include <vector> using namespace std; int main() { int val; vector<int> is; for (int i = 0; i < 5 && scanf("%d", &val); i++) is.push_back(val); sort(is.begin(), is.end()); for (int i = is.size() - 1; i > 0; i--) cout << is[i] << " "; cout << is[0] << endl...
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(is.begin(), is.end()); | ^~~~ | short
s097196493
p00018
C++
#include<iostream> using namespace std; int main(){ int a,b,c,d,e; int A,B,C,D,E; cin>>a>>b>>c>>d>>E; if(a>b){ A=a; B=b;} else{ A=b; B=a;} if(c<B){ C=c;} else{ C=B; if(c<A){ B=c;} else{ B=A; A=c;}} if(d<C){ D=d;} else{ D=C; if(d<B){ C=d;} else{ C=B; if(d<A){ B=d;} else{ B=A; A=d;}}} if(e<D){ E=e; else{ E=D; if(e<C){ D...
a.cc: In function 'int main()': a.cc:38:1: error: expected '}' before 'else' 38 | else{ | ^~~~ a.cc:36:8: note: to match this '{' 36 | if(e<D){ | ^
s580237800
p00018
C++
#include<iostream> #include<algorithm> #include<functional> using namespace std; int main(){ int a[5]; for(int i=0;i<5;i++) cin>>a[i]; sort(a,a+5,greater<int>()); for(int i=0;i<5;i++) cout<<a[i]1; }
a.cc: In function 'int main()': a.cc:9:40: error: expected ';' before numeric constant 9 | for(int i=0;i<5;i++) cout<<a[i]1; | ^ | ;
s633381330
p00018
C++
#include<iostream> using namespace std; int main(){ int a[5]; int biggest[5]; cin>>a[0]>>a[1]<<a[2]<<a[3]<<a[4]; biggest[0]=a[0]; for(int i=1;i<5;i++){ for(int j=0;j<i;j++){ if(a[i]>biggest[j]){ for(int k=i;k>j;k--){ biggest[k]=biggest[k-1];} biggest[j]=a[i]; break;}}} for(int i=0;i<5;i++){ cout<<biggest[i]<<" ";}}
a.cc: In function 'int main()': a.cc:7:16: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 7 | cin>>a[0]>>a[1]<<a[2]<<a[3]<<a[4]; | ~~~~~~~~~~~~~~~^~~~~~ | | | | | int ...
s768979333
p00018
C++
#include<iostream> using namespace std; int main(){ int a[5]; int biggest[5]; cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]; biggest[0]=a[0]; for(int i=1;i<5;i++){ for(int j=0;j<i;j++){ if(a[i]>biggest[j]){ for(int k=i;k>j;k--){ biggest[k]=biggest[k-1];} biggest[j]=a[i]; break;}}} cout<<biggest[0]<<" "<<biggest[1]<<" "<<biggest[2...
a.cc:17:2: error: expected declaration before '}' token 17 | }} | ^
s173022620
p00018
C++
#include <iostream> #include <string> using namespace std; int main(){ int a; int b[5]; int c; int d; int e; c=0; while(c<5){ b[c]=0; c=c+1; } c=0; while(c<5){ cin >>a; d=0; while(1){if(a>=b[d]){e=3; if(e>=d){while(e>=d){b[e+1]=b[e]; e=e-1;}} b[d]=a; break;} d=d+1; } c=c+1; } c=0; while(c<5){ cout << b[c] if(c<4){...
a.cc: In function 'int main()': a.cc:25:13: error: expected ';' before 'if' 25 | cout << b[c] | ^ | ; 26 | if(c<4){cout <<" "} | ~~
s374523859
p00018
C++
#include <iostream> #include <string> using namespace std; int main(){ int a; int b[5]; int c; int d; int e; c=0; while(c<5){ b[c]=0; c=c+1; } c=0; while(c<5){ cin >>a; d=0; while(1){if(a>=b[d]){e=3; if(e>=d){while(e>=d){b[e+1]=b[e]; e=e-1;}} b[d]=a; break;} d=d+1; } c=c+1; } c=0; while(c<5){ cout << b[c] if(c<4){...
a.cc: In function 'int main()': a.cc:25:13: error: expected ';' before 'if' 25 | cout << b[c] | ^ | ; 26 | if(c<4){cout <<" ";} | ~~
s195570590
p00018
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int a[5]; for(int i=1;i<6;i++){ cin>>a[i]; } sort(a+1,a+6); for(int i=5;i>0;i--){ cout<<a[i]<<' '; } endl; }
a.cc: In function 'int main()': a.cc:14:13: error: statement cannot resolve address of overloaded function 14 | endl; | ^
s525768628
p00018
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int a[5]; for(int i=1;i<6;i++){ cin>>a[i]; } sort(a+1,a+6); for(int i=5;i>0;i--){ if(i==1)cout<<a[i]<<; else cout<<a[i]<<' '; } cout<<endl; }
a.cc: In function 'int main()': a.cc:12:37: error: expected primary-expression before ';' token 12 | if(i==1)cout<<a[i]<<; | ^
s074783385
p00018
C++
l = map(int, raw_input().strip().split(" ")); print " ".join(sorted(l, lambda x, y: y - x));
a.cc:1:1: error: 'l' does not name a type 1 | l = map(int, raw_input().strip().split(" ")); | ^ a.cc:2:1: error: 'print' does not name a type; did you mean 'int'? 2 | print " ".join(sorted(l, lambda x, y: y - x)); | ^~~~~ | int
s607467080
p00018
C++
#include <algorithm> #include <functional> using namespace std; int main() { int input[5]; for (int i = 0; i < 5; i++) cin >> input[i]; sort(input, input + 5, greater<int>()); for (int i = 0; i < 5; i++) cout << input[i] << " "; cout << '\b\n'; // cout << input[0] << " " << i...
a.cc:17:13: warning: multi-character character constant [-Wmultichar] 17 | cout << '\b\n'; | ^~~~~~ a.cc: In function 'int main()': a.cc:11:9: error: 'cin' was not declared in this scope 11 | cin >> input[i]; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostr...
s001497187
p00018
C++
#include <algorithm> #include <functional> using namespace std; int main() { int input[5]; for (int i = 0; i < 5; i++) cin >> input[i]; sort(input, input + 5, greater<int>()); for (int i = 0; i < 5; i++) if (i != 4) cout << input[i] << " "; cout << endl; // cout <...
a.cc: In function 'int main()': a.cc:11:9: error: 'cin' was not declared in this scope 11 | cin >> input[i]; | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include <functional> +++ |+#include <iostream> ...
s156921443
p00018
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <deque> #include <functional> using namespace std; int main(void) { int a,b,c,d,e; while(cin>>a>>b>>c>>d>>e) { deque<int> nums; nums.push_back(a); nums.push_back(b); nums.push_back(c); nums.push_back(d); nums.push_back(e); sort( nums...
a.cc: In function 'int main()': a.cc:27:22: error: invalid use of non-static member function 'void std::deque<_Tp, _Alloc>::clear() [with _Tp = int; _Alloc = std::allocator<int>]' 27 | nums.clear; | ~~~~~^~~~~ In file included from /usr/include/c++/14/deque:66, ...
s403784485
p00018
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n[5]; for(int i=0;i<5;i++) cin >> n[i]; sort(n,n+5greater<int>()); for(int i=0;i<5;i++){ if(i!=4) cout << n[i] << ' '; else cout << n[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:12: error: unable to find numeric literal operator 'operator""greater' 7 | sort(n,n+5greater<int>()); | ^~~~~~~~ a.cc:7:21: error: expected primary-expression before 'int' 7 | sort(n,n+5greater<int>()); | ^~~
s033561529
p00018
C++
#include<iostream> #include<vector> std::vector<int> qsort(std::vector<int> xs); int main(){ std::vector<int> vec(5); for(int i=0;i<5;i++){ std::cin>>vec[i]; } vec=qsort(vec); for(int i=4;i>-1;i--){ std::cout<<vec[i]; if(i!=0)std::cout<<" "; } std::cout<<std::endl; return 0; } std::vector<int> qsort(...
a.cc: In function 'std::vector<int> qsort(std::vector<int>)': a.cc:31:18: error: expected '}' at end of input 31 | } | ^ a.cc:24:13: note: to match this '{' 24 | else{ | ^ a.cc:31:18: error: expected '}' at end of input 31 | } ...
s470933993
p00018
C++
#include <iostream> using namespace std; int main(void){ int a[5]; for( int i = 0 ; i < 5 ; i++ ){ cin >> a[i]; } sort( a , a + 5 ); for( int i = 4 ; i >= 0 ; i-- ){ cout << a[i]; if( i != 0 )cout << " "; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort( a , a + 5 ); | ^~~~ | short
s601534032
p00018
C++
#include <iostream> using namespace std; int main(void){ int a[5]; for( int i = 0 ; i < 5 ; i++ ){ cin >> a[i]; } sort( a , a + 5 ); for( int i = 4 ; i >= 0 ; i-- ){ cout << a[i]; if( i != 0 )cout << " "; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort( a , a + 5 ); | ^~~~ | short
s763149461
p00018
C++
x = sorted(map(int, raw_input().split()), reverse=True) for e in x: print e, print
a.cc:1:1: error: 'x' does not name a type 1 | x = sorted(map(int, raw_input().split()), reverse=True) | ^
s739325749
p00018
C++
#include <iostream> using namespace std; int main() { int a,b,c,d,e; cin>>a>>b>>c>>d>>e; int num[]={a,b,c,d,e}; for(int i=0;i<5;i++) for(int j=i+1;j<5;j++) if(num[i]<num[j]) swap(num[i],num[j]); a=num[0]; b=num[1]; c=num[2]; d=num[3]; e=num[4]; cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;<<" "<< }
a.cc: In function 'int main()': a.cc:17:55: error: expected primary-expression before '<<' token 17 | cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<endl;<<" "<< | ^~ a.cc:18:1: error: expected primary-expression before '}' token 18 | } | ^
s358956566
p00019
Java
def fact(a): if a == 0: return 1 return fact(a-1) * a print fact(input())
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. def fact(a): ^ (use --enable-preview to enable unnamed classes) Main.java:1: error: <identifier> expected def fact(a): ^ Main.java:1: error: ';' expected def fact(a): ^ 3 errors
s432358576
p00019
Java
import java.io.* class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str; while((str=br.readLine())!=null){ int x=Integer.parseInt(str); System.out.println(fact(x)); } } private static int fact(int x){ if(x==1)return 1; r...
Main.java:1: error: ';' expected import java.io.* ^ 1 error
s958693593
p00019
Java
import java.util.*; public class aop { /** * @param args */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while(n>=1 && n<=10){ System.out.println(Math.pow(n,n)); n = sc.nextInt(); } } }
Main.java:2: error: class aop is public, should be declared in a file named aop.java public class aop { ^ 1 error
s927416429
p00019
Java
public class factorial{ public static void main(String args[]){ int n = Integer.parseInt(args[0]); int answer = 1; while (n != 0){ answer *= n; n--; } System.out.println(answer); } }
Main.java:1: error: class factorial is public, should be declared in a file named factorial.java public class factorial{ ^ 1 error
s486013137
p00019
Java
public class Factorial{ public static void main(String args[]){ int n = Integer.parseInt(args[0]); int answer = 1; while (n != 0){ answer *= n; n--; } System.out.println(answer); } }
Main.java:1: error: class Factorial is public, should be declared in a file named Factorial.java public class Factorial{ ^ 1 error
s411940719
p00019
Java
import java.util.*; public class Sort { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = 1; for(int i = sc.nextInt();i!=0;i--){ a *= i; } System.out.println(a); } }
Main.java:2: error: class Sort is public, should be declared in a file named Sort.java public class Sort { ^ 1 error
s432086241
p00019
Java
import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); long i = sc.nextLong(); Long a = 1; for(;i>0;i--){ a *= i; } System.out.println(a); } }
Main.java:6: error: incompatible types: int cannot be converted to Long Long a = 1; ^ 1 error
s945339035
p00019
Java
import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int i = sc.nextLong(); long a = 1; for(;i>0;i--){ a *= i; } System.out.println(a); } }
Main.java:5: error: incompatible types: possible lossy conversion from long to int int i = sc.nextLong(); ^ 1 error
s455707562
p00019
Java
public class Fact { public static void main(String args[]) { for (int counter = 0; counter <= 10; counter++){ System.out.printf("%d! = %d\n", counter, factorial(counter)); } } public static long factorial(long number) { if (number <= 1) return 1; else ...
Main.java:1: error: class Fact is public, should be declared in a file named Fact.java public class Fact { ^ 1 error
s358520220
p00019
Java
import java.util.Scanner; public class Factorial{ public static void main(String args[]){ Scanner scanner = new Scanner(System.in); System.out.println("Enter the number:"); int num = scanner.nextInt(); int factorial = fact(num); System.out.println("Factorial of entere...
Main.java:2: error: class Factorial is public, should be declared in a file named Factorial.java public class Factorial{ ^ 1 error
s771754720
p00019
Java
package Factorial; import java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int number = in.nextInt(); if (number <= 1 || number >= 20) { } else { S...
Main.java:5: error: class Factorial is public, should be declared in a file named Factorial.java public class Factorial { ^ 1 error
s023761299
p00019
Java
import java.util.Scanner; public class Factorial { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int number = in.nextInt(); if (number <= 1 || number >= 20) { } else { System.out.println(f...
Main.java:4: error: class Factorial is public, should be declared in a file named Factorial.java public class Factorial { ^ 1 error