submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s828552921 | p00001 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main(){
int hills[10];
char string[256];
fgets(string, 256, stdin);
for (int i = 0; i < 10; i++){
char* one;
one = strtok(string, "\n");
hills[i] = atoi(one);
}
int top[4] = {0};
for (int i = 0; i < 10; i++){
if (hills[i] ... | a.cc: In function 'int main()':
a.cc:12:23: error: 'strtok' was not declared in this scope; did you mean 'strtoq'?
12 | one = strtok(string, "\n");
| ^~~~~~
| strtoq
|
s417815299 | p00001 | C++ | #include<iostream.h>
#include<conio.h>
using namespace std;
int main()
{
int mountheight[10];
for(int i=0;i<10;i++)
{
cin>>mountheight[i];
}
int max[3];
max[0]=mountheight[0];
max[1]=mountheight[0];
max[2]=mountheight[0];
for(i=1;i<10;i++)
{
if(mountheight[i]>max[0])
{
max[0]=mountheight[i];
}
}
for(i=1;i<10;i++)
{
if... | a.cc:1:9: fatal error: iostream.h: No such file or directory
1 | #include<iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s327274611 | p00001 | C++ | #include<iostream>
#include<conio>
using namespace std;
void main()
{
clrscr();
int mount[10];
for(int i=0;i<10;i++)
{
cin >> mount[i];
}
int max[3];
max[0] = mount[0];
max[1] = mount[0];
max[2] = mount[0];
for(i=1;i<10;i++)
{
if(mount[i]>max[0])
{
max[0] = mount[i];
}
}
for(i=1;i<10;i++)
{
if(mount[i]>max[1]&&mount[i... | a.cc:2:9: fatal error: conio: No such file or directory
2 | #include<conio>
| ^~~~~~~
compilation terminated.
|
s325097313 | p00001 | C++ | #include<iostream>
using namespace std;
int main()
{
int mount[10];
for(int i=0;i<10;i++)
{
cin >> mount[i];
}
int max[3];
max[0] = mount[0];
max[1] = mount[0];
max[2] = mount[0];
for(i=1;i<10;i++)
{
if(mount[i]>max[0])
{
max[0] = mount[i];
}
}
for(i=1;i<10;i++)
{
if(mount[i]>max[1]&&mount[i]!=max[0])
{
max[1] = mount... | a.cc: In function 'int main()':
a.cc:15:5: error: 'i' was not declared in this scope
15 | for(i=1;i<10;i++)
| ^
a.cc:22:5: error: 'i' was not declared in this scope
22 | for(i=1;i<10;i++)
| ^
a.cc:29:5: error: 'i' was not declared in this scope
29 | for(i=1;i<10;i++)
| ^
a.cc: At ... |
s918319379 | p00001 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int heights[10];
for(int i=0;i<10;i++)
{
cin>>heights[i];
}
sort(0,9);
cout<<"height of 1st mountain "<<heights[9]<<endl;
cout<<"height of 2nd mountain "<<heights[8]<<endl;
cout<<"height of 3rd mountain "... | 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... |
s065464834 | p00001 | C++ | #include<stdio.h>
#include<conio.h>
#include<iostream>
#include<stdlib.h>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
vector<int> vec;
int temp;
for (int i = 0; i < 10; i++)
{
cin >> temp;
vec.push_back(temp);
}
make_heap(vec.begin(), vec.end());
for (int i = 0; i < 3; i ++ )
{
... | a.cc:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s842369959 | p00001 | C++ | #include <iostream> using namespace std; int main() { int i=0; int num[10]; for(;i<10;i++) cin>>num[i]; int temp=0,temp1=0,j=0,k=0; for(;j<3;j++) { for(i=0;i<10;i++) { temp1=temp; temp=temp<num[i]?num[i]:temp; if(temp>temp1) k=i; } cout<<num[k]<<endl; temp=0; num[k]=0; } return 0; } | a.cc:1:21: warning: extra tokens at end of #include directive
1 | #include <iostream> using namespace std; int main() { int i=0; int num[10]; for(;i<10;i++) cin>>num[i]; int temp=0,temp1=0,j=0,k=0; for(;j<3;j++) { for(i=0;i<10;i++) { temp1=temp; temp=temp<num[i]?num[i]:temp; if(temp>temp1) k=i; } cout<<num[k]<<endl... |
s400614851 | p00001 | C++ | inputs = []
10.times do
inputs << gets.to_i
end
puts inputs.sort.reverse[0..2] | a.cc:7:26: error: too many decimal points in number
7 | puts inputs.sort.reverse[0..2]
| ^~~~
a.cc:1:1: error: 'inputs' does not name a type
1 | inputs = []
| ^~~~~~
|
s330554879 | p00001 | C++ | a = []
10.times do
a << gets.to_i
end
a.sort!.reverse!
p a[0]
p a[1]
p a[2] | a.cc:1:1: error: 'a' does not name a type
1 | a = []
| ^
|
s560405487 | p00001 | C++ | #include <iostream>
using namespace std;
int main()
{
int x[10];
int i,j,tmp;
for(i=0;i<10;i++){
cin >> x[i];
}
for(i=0;i<n-1;i++){
for(j=n-1;j>i;j--){
if(x[j]<x[j-1]){
tmp = x[j];
x[j] = x[j-1];
x[j-1] = x[j];
}
}
}
cout <<x[0] <<endl;
cout <<x[1] <<endl;
cout <<x[2] <<endl;
fo... | a.cc: In function 'int main()':
a.cc:11:19: error: 'n' was not declared in this scope
11 | for(i=0;i<n-1;i++){
| ^
|
s664953407 | p00001 | C++ | #include <iostream>
using namespace std;
int main()
{
int x[10];
int i,j,tmp;
for(i=0;i<10;i++){
cin >> x[i];
}
for(i=0;i<n-1;i++){
for(j=n-1;j>i;j--){
if(x[j]<x[j-1]){
tmp = x[j];
x[j] = x[j-1];
x[j-1] = x[j];
}
}
}
cout <<x[0] <<endl;
cout <<x[1] <<endl;
cout <<x[2] <<endl;
... | a.cc: In function 'int main()':
a.cc:11:19: error: 'n' was not declared in this scope
11 | for(i=0;i<n-1;i++){
| ^
|
s299198893 | p00001 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int x[10];
int i,j,tmp;
for(i=0;i<10;i++){
cin >> x[i];
}
sort(x);
cout <<x[9] <<endl;
cout <<x[8] <<endl;
cout <<x[7] <<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:13: error: no matching function for call to 'sort(int [10])'
13 | sort(x);
| ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter... |
s269700920 | p00001 | C++ | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int in;
vector<int> v;
while(cin >> in)
{
v.push_back(in);
}
sort(v.begin(), v.end(), greater<int>());
for(int i = 0; i < 3 : i++)
{
cout << v[i] << endl;
}
} | a.cc: In function 'int main()':
a.cc:15:20: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
15 | for(int i = 0; i < 3 : i++)
| ^
a.cc:15:25: error: expected ';' before ':' token
15 | for(int i = 0; i < 3 : i... |
s865066904 | p00001 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
int i, input;
vector<int> heights;
for (i = 0; i < 10; i++) {
cin >> input;
heights.push_back(input);
}
sort(heights.rbegin(), heights.rend());
cout << heights.at(0) << e... | a.cc: In function 'int main()':
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'short'?
16 | sort(heights.rbegin(), heights.rend());
| ^~~~
| short
|
s437602922 | p00001 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
vector<int> height;
int a;
while(cin>>a){
height.push_back(a);
}
sort(height.begin(). height.end(), greater<int>());
for(int i = 0; i < 3; i++)
cout << height[i] << endl;
} | a.cc: In function 'int main()':
a.cc:11:22: error: 'std::vector<int>::iterator' has no member named 'height'
11 | sort(height.begin(). height.end(), greater<int>());
| ^~~~~~
|
s749538365 | p00001 | C++ | import sys
a = []
s = sys.stdin.readline()
while s :
a.append(int(s))
s = sys.stdin.readline()
a.sort()
a.reverse()
for i in range(3) :
print(a[i]); | a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s995129621 | p00001 | C++ | #include<iostream>
using namespace std;
int main(void){
int h[10];
int a = 0;
cin >> h;
for(int j=0; j<3; j++){
for(int i=0; i<10; i++){
if(a<h[i]) a = i;
}
cout << h[a] <<endl;
h[a] = 0;
}
return(0);
} | a.cc:7:1: error: extended character is not valid in an identifier
7 | int a = 0;
| ^
a.cc: In function 'int main()':
a.cc:7:1: error: '\U00003000int' was not declared in this scope
7 | int a = 0;
| ^~~~~
a.cc:9:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basi... |
s932682653 | p00001 | C++ | #include<iostream>
using namespace std;
int main(void){
int h[10];
int a = 0;
cin >> h;
for(int j=0; j<3; j++){
for(int i=0; i<10; i++){
if(a<h[i]) a = i;
}
cout << h[a] << endl;
h[a] = 0;
}
return 0;
} | a.cc:7:1: error: extended character is not valid in an identifier
7 | int a = 0;
| ^
a.cc: In function 'int main()':
a.cc:7:1: error: '\U00003000int' was not declared in this scope
7 | int a = 0;
| ^~~~~
a.cc:9:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basi... |
s782939312 | p00001 | C++ | #include<iostream>
using namespace std;
int main(void){
int h[10];
int a = 0;
std::cin >> h;
for(int j=0; j<3; j++){
for(int i=0; i<10; i++){
if(a<h[i]) a = i;
}
cout << h[a] << endl;
h[a] = 0;
}
return 0;
} | a.cc:7:1: error: extended character is not valid in an identifier
7 | int a = 0;
| ^
a.cc: In function 'int main()':
a.cc:7:1: error: '\U00003000int' was not declared in this scope
7 | int a = 0;
| ^~~~~
a.cc:9:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::bas... |
s092834066 | p00001 | C++ | #include<iostream>
using namespace std;
int main(void){
int h[10];
int a = 0;
std::cin >> h;
for(int j=0; j<3; j++){
for(int i=0; i<10; i++){
if(h[a]<h[i]) a = i;
}
cout << h[a] << endl;
h[a] = 0;
}
return 0;
} | a.cc:7:1: error: extended character is not valid in an identifier
7 | int a = 0;
| ^
a.cc: In function 'int main()':
a.cc:7:1: error: '\U00003000int' was not declared in this scope
7 | int a = 0;
| ^~~~~
a.cc:9:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::bas... |
s033986178 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int height[10];
int TopOfThree[3];
for(i = 0;i < 10;i++)
cin >> height[i];
for(int i = 0;i < 3;i++)
{
TopOfThree[i] = height[0];
for(int j = 1;j < 10 - i;i++)
{
int index = 0;
if(TopOf... | a.cc: In function 'int main()':
a.cc:9:9: error: 'i' was not declared in this scope
9 | for(i = 0;i < 10;i++)
| ^
a.cc:26:21: error: 'index' was not declared in this scope
26 | for(int k = index;k < 10;k++)
| ^~~~~
|
s445602609 | p00001 | C++ | import java.util.Scanner;
import java.util.Arrays;
class Main{
public static void main(String args[]){
int[] h = new int[10];
Scanner scan = new Scanner(System.in);
for(int i = 0; i < 10; i++){
h[i] = Integer.parseInt(scan.next());
}
Arrays.sort(h);
Syste... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Arrays;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s285790829 | p00001 | C++ | #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int main(){
vector<int> h(10);
for(int i=0;i<10;++i) cin>>h[i];
sort(begin(v),end(v),greater<int>());
for(int i=0;i<3;++i) cout<<h[i]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:14: error: 'v' was not declared in this scope
12 | sort(begin(v),end(v),greater<int>());
| ^
|
s304302679 | p00001 | C++ | #include<algorithm>
a[10],i
main(){
for(;i<10;scanf("%d",a+i++));
} | a.cc:2:1: error: 'a' does not name a type
2 | a[10],i
| ^
|
s706481076 | p00001 | C++ | #include<algorithm>a[10],imain(){ for(;i<10;scanf("%d",a+i++)); sort(a,a+10);for(;i>7;printf("%d\n",a+--i));return 0;} | a.cc:1:21: warning: extra tokens at end of #include directive
1 | #include<algorithm>a[10],imain(){ for(;i<10;scanf("%d",a+i++)); sort(a,a+10);for(;i>7;printf("%d\n",a+--i));return 0;}
| ^
a.cc:1:9: fatal error: algorithm>: No such file or directory
1 | #include<algorithm>a[10],imai... |
s246062138 | p00001 | C++ | #include<algorithm>a[10],i;main(){ for(;i<10;scanf("%d",a+i++)); sort(a,a+10);for(;i>7;printf("%d\n",a+--i));return 0;} | a.cc:1:21: warning: extra tokens at end of #include directive
1 | #include<algorithm>a[10],i;main(){ for(;i<10;scanf("%d",a+i++)); sort(a,a+10);for(;i>7;printf("%d\n",a+--i));return 0;}
| ^
a.cc:1:9: fatal error: algorithm>: No such file or directory
1 | #include<algorithm>a[10],i;m... |
s243828551 | p00001 | C++ | #include<algorithm>a[10],imain(){ for(;i<10;scanf("%d",a+i++)); sort(a,a+10);for(;i>7;printf("%d\n",a+(--i)));return 0;} | a.cc:1:21: warning: extra tokens at end of #include directive
1 | #include<algorithm>a[10],imain(){ for(;i<10;scanf("%d",a+i++)); sort(a,a+10);for(;i>7;printf("%d\n",a+(--i)));return 0;}
| ^
a.cc:1:9: fatal error: algorithm>: No such file or directory
1 | #include<algorithm>a[10],im... |
s098215785 | p00001 | C++ |
class q2
{
public static void main(String[] av)
{
java.util.Scanner sc = new java.util.Scanner(System.in);
java.util.ArrayList<Integer> vec = new java.util.ArrayList<Integer>();
while( sc.hasNextInt() )
{
vec.add( sc.nextInt() );
}
java.util.Collections.sort( vec );
java.util.Collections.reverse( v... | a.cc:4:15: error: expected ':' before 'static'
4 | public static void main(String[] av)
| ^~~~~~~
| :
a.cc:4:33: error: 'String' has not been declared
4 | public static void main(String[] av)
| ^~~~~~
a.cc:4:42: error:... |
s959762642 | p00001 | C++ |
class Main
{
public static void main(String[] av)
{
java.util.Scanner sc = new java.util.Scanner(System.in);
java.util.ArrayList<Integer> vec = new java.util.ArrayList<Integer>();
while( sc.hasNextInt() )
{
vec.add( sc.nextInt() );
}
java.util.Collections.sort( vec );
java.util.Collections.reverse(... | a.cc:4:15: error: expected ':' before 'static'
4 | public static void main(String[] av)
| ^~~~~~~
| :
a.cc:4:33: error: 'String' has not been declared
4 | public static void main(String[] av)
| ^~~~~~
a.cc:4:42: error:... |
s606494279 | p00001 | C++ | #include <iostream>
#include <array>
#include <utility>
template<class T>
T input()
{
T val;
std::cin >> val;
return val;
}
int main()
{
std::array<int, 10> high;
for (int i = 0; i < 10; ++i)
high[i] = input<int>();
std::sort(high.begin(), high.end());
std::cout << high[9] << " " << high[8] << " " << high[... | a.cc: In function 'int main()':
a.cc:19:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
19 | std::sort(high.begin(), high.end());
| ^~~~
| qsort
|
s138861399 | p00001 | C++ | #include <iostream>
#include <array>
#include <utility>
template<class T>
T input()
{
T val;
std::cin >> val;
return val;
}
int main()
{
std::array<int, 10> high;
for (int i = 0; i < 10; ++i)
high[i] = input<int>();
std::sort(high.begin(), high.end());
std::cout << high[9] << " " << high[8] << " " << high[... | a.cc: In function 'int main()':
a.cc:19:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
19 | std::sort(high.begin(), high.end());
| ^~~~
| qsort
|
s268402037 | p00001 | C++ | #include <iostream>
#include <array>
#include <utility>
int main()
{
std::array<int, 10> high;
for (int i = 0; i < 10; ++i)
std::cin >> high[i];
std::sort(high.begin(), high.end());
std::cout << high[9] << " " << high[8] << " " << high[7] << std::endl;
} | a.cc: In function 'int main()':
a.cc:11:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
11 | std::sort(high.begin(), high.end());
| ^~~~
| qsort
|
s918589911 | p00001 | C++ | #include<stdio.h>
#include<algorithm.h>
using namespace std;
int main(){
int i, height[10];
for(i=0;i<10;i++){
scanf("%d", &height[i]);
}
sort(height, height+10, greater<int>());
for(i=0;i<2;i++){
printf("%d\n", height[i]);
}
return 0;
} | a.cc:2:9: fatal error: algorithm.h: No such file or directory
2 | #include<algorithm.h>
| ^~~~~~~~~~~~~
compilation terminated.
|
s181320599 | p00001 | C++ | #include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
int i, height[10];
for(i=0;i<10;i++){
scanf("%d", &height[i]);
}
sort(height, height+10, greater<int>());
for(i=0;i<2;i++){
printf("%d\n", height[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:26: error: 'greater' was not declared in this scope
12 | sort(height, height+10, greater<int>());
| ^~~~~~~
a.cc:12:34: error: expected primary-expression before 'int'
12 | sort(height, height+10, greater<int>());
| ... |
s035439320 | p00001 | C++ | #include<stdio.h>
#include<algorithm>
#include<functional>
 
using namespace std;
   
int main(){
   
 int i, height[10];
 for(i=0;i<10;i++){
  scanf("%d", &height[i]);
 }
 sort(height, height+10, greater<int>());
   
 for(i=0;i<3;i++... | a.cc:4:2: error: stray '#' in program
4 |  
| ^
a.cc:6:2: error: stray '#' in program
6 |    
| ^
a.cc:6:8: error: stray '#' in program
6 |    
| ^
a.cc:6:14: error: stray '#' in program
6 |    
| ^
a.cc:8:2:... |
s572366050 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int hest[3];
for(int i=0,int h=0;i<10;i++){
std::cin>>h;
for(int j=0;j<3;j++){
if(hest[i]<h){
hest[i] = h;
}
}
}
for(int j=0;j<3;j++){
std::cout<<hest[i]<<std::endl;
}
r... | a.cc: In function 'int main()':
a.cc:6:17: error: expected unqualified-id before 'int'
6 | for(int i=0,int h=0;i<10;i++){
| ^~~
a.cc:6:17: error: expected ';' before 'int'
6 | for(int i=0,int h=0;i<10;i++){
| ^~~
| ;
a.cc:6:29: error: exp... |
s044256648 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int hest[3];
int h;
for(int i=0;i<10;i++){
std::cin>>h;
for(int j=0;j<3;j++){
if(hest[i]<h){
hest[i] = h;
}
}
}
for(int j=0;j<3;j++){
std::cout<<hest[i]<<std::endl;
}
... | a.cc: In function 'int main()':
a.cc:17:25: error: 'i' was not declared in this scope
17 | std::cout<<hest[i]<<std::endl;
| ^
|
s492122654 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int hest[3]={0,0,0};
int h;
for(int i=0;i<10;i++){
std::cin>>h;
for(int j=0;j<3;j++){
if(hest[j]<h){
hest[j] = h;
}
}
}
for(int j=0;j<3;j++){
std::cout<<hest[i]<<std::endl;
... | a.cc: In function 'int main()':
a.cc:17:25: error: 'i' was not declared in this scope
17 | std::cout<<hest[i]<<std::endl;
| ^
|
s947078579 | p00001 | C++ | #include <stdio.h>
int main(void) {
int n;
n=0;
if (n<0 && n>10000)
{
return 1;
}
for(n=0; n<10 ;n++)
{
printf("height of mountain %d\n", %n);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:51: error: expected primary-expression before '%' token
14 | printf("height of mountain %d\n", %n);
| ^
|
s955517287 | p00001 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int data,m[10];
while(cin >> data)
{
for (int j=0;j<=9;j++){
if (data<=10000 && data >= 0)
m[j]=data;
}
for (int j=0;j<=9;j++){
for (int i=0;i<=9;i++){
if (m[i] <= m[i+1])
std::swap(m[i],m[i+1]);
}
}
for (int i=0;... | a.cc: In function 'int main()':
a.cc:31:2: error: expected '}' at end of input
31 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s800876060 | p00001 | C++ | #include <iostream>
int main() {
int heights[16] = { 0 };
int temp_result = 0;
int index = 12;
for(int i = 0; i < 10; i++) {
std::cin >> heights[i];
}
for(int j = 0; j < 3; j++) {
heights[index] = 0;
index = 0;
temp_result = 0;
for(int i = 0; i < 10 i++) {
if(temp_result < heigh... | a.cc: In function 'int main()':
a.cc:16:26: error: expected ';' before 'i'
16 | for(int i = 0; i < 10 i++) {
| ^~
| ;
|
s866234817 | p00001 | C++ | #Include <iostream>
using namespace std;
const static int MAX = 10000;
int main() {
int R[MAX]={0};
int i;
for (int i=0; i < 10; i++ ) {
cin >> i;
R[i]=i;
}
for (int j=MAX - 1; j>0 ; j--){
int cnt = 0;
if (cnt <= 3) break;
if (R[j] != 0){
cout << R[i] << endl;
cnt++;
}
return 0;
}
} | a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
1 | #Include <iostream>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:11:1: error: 'cin' was not declared in this scope
11 | cin >> i;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>... |
s963188753 | p00001 | C++ | #include<iostream>
using namespace std;
int main()
{
int high[10] = { };
int first = 0, second = 0, third = 0;
for(int i = 0; i < 10; i++){
cin >> high[i];
if(first <= high[i]){
second = first;
third = econd;
first = high[i];
}
else if(second <= high[i]){
third = second;
second = high[i... | a.cc: In function 'int main()':
a.cc:15:33: error: 'econd' was not declared in this scope; did you mean 'second'?
15 | third = econd;
| ^~~~~
| second
|
s515052515 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int work[10];
int temp;
for(int i = 0; i < 10; i++){
cin >> work[i];
}
for(int i = 0; i < 9; i++){
for(j = i + 1; j < 10; j++){
if(work[i] < work[j]){
temp = work[i];
work[i] = work[j];
... | a.cc: In function 'int main()':
a.cc:10:13: error: 'j' was not declared in this scope
10 | for(j = i + 1; j < 10; j++){
| ^
|
s051948205 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int work[10];
int temp;
for(int i = 0; i < 10; i++){
cin >> work[i];
}
for(int i = 0; i < 9; i++){
for(j = i + 1; j < 9; j++){
if(work[i] < work[j]){
temp = work[i];
work[i] = work[j];
... | a.cc: In function 'int main()':
a.cc:10:13: error: 'j' was not declared in this scope
10 | for(j = i + 1; j < 9; j++){
| ^
|
s384480072 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int work[10];
int temp;
for(int i = 0; i < 10; i++){
cin >> work[i];
}
for(int i = 0; i < 9; i++){
for(j = i + 1; j <= 9; j++){
if(work[i] < work[j]){
temp = work[i];
work[i] = work[j];
... | a.cc: In function 'int main()':
a.cc:10:13: error: 'j' was not declared in this scope
10 | for(j = i + 1; j <= 9; j++){
| ^
|
s327146284 | p00001 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int input[10];
for(int i = 0; i < 10; i++){
cin >> input[i];
}
for(int i = 3; i < 10; i++){
for(int j = 0; j < 3; j++){
if(input[i] > input[j]){
input[j] = input[i];
break;
}
}
}
sort(input, input+2);
for(int i = 0; i < 3; i++){... | a.cc: In function 'int main()':
a.cc:23:9: error: 'sort' was not declared in this scope; did you mean 'short'?
23 | sort(input, input+2);
| ^~~~
| short
|
s012312705 | p00001 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int input[10];
for(int i = 0; i < 10; i++){
cin >> input[i];
}
for(int i = 3; i < 10; i++){
for(int j = 0; j < 3; j++){
if(input[i] > input[j]){
input[j] = input[i];
break;
}
}
}
sort(input, input+3, less<int>());
for(int i = 0;... | a.cc: In function 'int main()':
a.cc:23:9: error: 'sort' was not declared in this scope; did you mean 'short'?
23 | sort(input, input+3, less<int>());
| ^~~~
| short
|
s123043417 | p00001 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int input[10];
for(int i = 0; i < 10; i++){
cin >> input[i];
}
for(int i = 3; i < 10; i++){
for(int j = 0; j < 3; j++){
if(input[i] > input[j]){
input[j] = input[i];
break;
}
}
}
sort(input, input+3, less<int>());
for(int i = 0;... | a.cc: In function 'int main()':
a.cc:23:9: error: 'sort' was not declared in this scope; did you mean 'short'?
23 | sort(input, input+3, less<int>());
| ^~~~
| short
|
s872629334 | p00001 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(int argc, char *argv[]){
int n;
vector<int> a;
while(cin >> n){
a.push_back(-n);
}
sort(a.begin(), a.end());
std::cout << -a[0] << std::endl;
std::cout << -a[1] << std::endl;
std::cout << -a[2] << std::endl;
return 0;
} | a.cc: In function 'int main(int, char**)':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
11 | sort(a.begin(), a.end());
| ^~~~
| short
|
s488726069 | p00001 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> h(10);
for (int i = 0; i < 10; ++i) cin >> h[i];
sort( h.begin(), h.end(), greater<int> );
cout << h[0] << endl;
cout << h[1] << endl;
cout << h[2] << endl;
} | a.cc: In function 'int main()':
a.cc:11:48: error: expected primary-expression before ')' token
11 | sort( h.begin(), h.end(), greater<int> );
| ^
|
s005658160 | p00001 | C++ | # -*- config: utf-8 -*-
if __name__ == '__main__':
hills = []
for i in range(10):
tmp = raw_input()
hills.append(int(tmp))
hills.sort(reverse=True)
for i in range(3):
print hills[i] | a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- config: utf-8 -*-
| ^
a.cc:2:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
2 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:2:1: error: expected unqualified-id before 'if'
2 | if... |
s158280391 | p00001 | C++ | File Edit Options Buffers Tools C++ Help
#include<iostream>
using namespace std;
int main(){
int x, buf, i, j;
int top[3];
for(i = 0; i < 3; i++)
top[i] = 0;
for(i = 0; i < 10; i++){
cin >> x;
if(x > top[2]){
top[2] = x;
j = 2;
while(j > 0){
if(top[j-1] <top[j]){
... | a.cc:1:1: error: 'File' does not name a type
1 | File Edit Options Buffers Tools C++ Help
| ^~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
... |
s248262244 | p00001 | C++ | #include <stdio.h>
int main(void)
{
int i,h[10];
for(i=0;i<10;i++){
scanf("%d",&h[i]);
}
printf("%d",fir(h));
printf("%d",sec(h));
printf("%d",thi(h));
return 0;
}
int fir(const int *h){
int i,f=0;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し*/;
}
return f;
}
int sec(const int *h){
int i,f,s;
for(i=0... | a.cc: In function 'int main()':
a.cc:9:21: error: 'fir' was not declared in this scope
9 | printf("%d",fir(h));
| ^~~
a.cc:10:21: error: 'sec' was not declared in this scope
10 | printf("%d",sec(h));
| ^~~
a.cc:11:21: error: 'thi' was not declar... |
s162121182 | p00001 | C++ | #include <stdio.h>
int fir(const int*);
int sec(const int*);
int thi(const int*);
int main(void)
{
int i,h[10];
for(i=0;i<10;i++){
scanf("%d",&h[i]);
}
printf("%d",fir(h));
printf("%d",sec(h));
printf("%d",thi(h));
return 0;
}
int fir(const int *h){
int i,f=0;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し... | a.cc: In function 'int fir(const int*)':
a.cc:22:47: error: expected primary-expression before ';' token
22 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc: In function 'int sec(const int*)':
a.cc:30:47: error: expected primary-expression before ';' token
... |
s274017650 | p00001 | C++ | #include <stdio.h>
int fir(const int *);
int sec(const int *);
int thi(const int *);
int main(void)
{
int i,h[10];
for(i=0;i<10;i++){
scanf("%d",&h[i]);
}
printf("%d",fir(h));
printf("%d",sec(h));
printf("%d",thi(h));
return 0;
}
int fir(const int *h){
int i,f=0;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処... | a.cc: In function 'int fir(const int*)':
a.cc:22:47: error: expected primary-expression before ';' token
22 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc: In function 'int sec(const int*)':
a.cc:30:47: error: expected primary-expression before ';' token
... |
s196847315 | p00001 | C++ | #include <stdio.h>
int fir(const int *);
int sec(const int *);
int thi(const int *);
int main(void)
{
int i,h[10];
for(i=0;i<10;i++){
scanf("%d",&h[i]);
}
printf("%d",fir(h));
printf("%d",sec(h));
printf("%d",thi(h));
return 0;
}
int fir(const int *h){
int i,f=0;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処... | a.cc: In function 'int fir(const int*)':
a.cc:22:47: error: expected primary-expression before ';' token
22 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc: In function 'int sec(const int*)':
a.cc:30:47: error: expected primary-expression before ';' token
... |
s821179435 | p00001 | C++ | #include <iostream>
using namespace std;
int main(){
int m[10];
for(int i=0;i<10;i++) cin >> m[i];
while(1){
bool j = true;
for(int i=0;i<9;i++){
if(m[i]<m[i+1]){
int t = m[i];
m[i] = m[i+1];
m[i+1] = t;
j = false;
}
}
if(J) break;
}
for(int i=0;i<3;i++) cout << m[i] << endl;
} | a.cc: In function 'int main()':
a.cc:16:20: error: 'J' was not declared in this scope
16 | if(J) break;
| ^
|
s725690168 | p00001 | C++ | hoge | a.cc:1:1: error: 'hoge' does not name a type
1 | hoge
| ^~~~
|
s230608216 | p00001 | C++ | #include<stdio.h>
int main(){
int a,i,j;
int a[10];
for(i=0;i<10;i++){
scanf("%d",&a[i]);
}
for(i=0;i<9;i++){
for(j=0;j<9-i;j++){
if(a[j]<a[j+1]){
int temp =a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
for(i=0;i<3;i++){
printf("%d\n",a[i]);
}
return 0; | a.cc: In function 'int main()':
a.cc:4:13: error: conflicting declaration 'int a [10]'
4 | int a[10];
| ^
a.cc:3:13: note: previous declaration as 'int a'
3 | int a,i,j;
| ^
a.cc:6:30: error: invalid types 'int[int]' for array subscript
6 | ... |
s327043548 | p00001 | C++ | #include<stdio.h>
int main(){
int a;
int a[10];
int i;
int j;
for(i=0;i<10;i++){
scanf("%d",&a[i]);
}
for(i=0;i<9;i++){
for(j=0;j<9-i;j++){
if(a[j]<a[j+1]){
int temp =a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
for(i=0;i<3;i++){
printf("%d\n",a[i]);
}
return 0;
... | a.cc: In function 'int main()':
a.cc:4:13: error: conflicting declaration 'int a [10]'
4 | int a[10];
| ^
a.cc:3:13: note: previous declaration as 'int a'
3 | int a;
| ^
a.cc:8:30: error: invalid types 'int[int]' for array subscript
8 | sca... |
s823395176 | p00001 | C++ | import java.io.bufferedreader;
import java.io.inputstreamreader;
import java.util.arrays;
class aoj001{
public static void main(string[] a){
bufferedreader br = new bufferedreader(new inputstreamreader(system.in));
int[] arr = new int[10];
for (int i = 0; i<10; i++)
arr[i] = integer.parseint(br.re... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.bufferedreader;
| ^~~~~~
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 java.io.inputstreamreader;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available wit... |
s972082393 | p00001 | C++ | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.arrays;
class aoj001{
public static void main(string[] a){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] arr = new int[10];
for (int i = 0; i<10; i++)
arr[i] = integer.parseint(br.re... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
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 java.io.InputStreamReader;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available wit... |
s906521504 | p00001 | C++ | #include<iostream>
using namespace std;
int number[10];
int count = 0;
int flag = 0;
int temp = 0;
int main(){
for(count=0;count<10;count++){
cin >> number[count];
}
count = 0;
while(flag<10){
for(count=0;count<9;count++){
... | a.cc: In function 'int main()':
a.cc:21:49: error: 'tempa' was not declared in this scope; did you mean 'temp'?
21 | number[count+1]=tempa;
| ^~~~~
| temp
|
s257075910 | p00001 | C++ | 1819
2003
876
2840
1723
1673
3776
2848
1592
922 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1819
| ^~~~
|
s186993406 | p00001 | C++ | #include<iostream>
using namespace std;
int main()
{
int a,mountain[10],j,k;
for(int i=0;i<10;i++){
cin>>moutain[i];
}
for(j=0;j<10;j++){
for(k=0;k<10-j;k++){
if(mountain[k]<mountain[k+1]){
a=mountain[k];
mountain[k]=montain[k+1];
mountain[k+1]=a;
}
}
}
cout<<mountain[0]<<"\n"<<moutnain[1]... | a.cc: In function 'int main()':
a.cc:7:22: error: 'moutain' was not declared in this scope; did you mean 'mountain'?
7 | cin>>moutain[i];
| ^~~~~~~
| mountain
a.cc:13:45: error: 'montain' was not declared in this scope; did you mean 'mountain'?
... |
s850234629 | p00001 | C++ | #include<iostream>
int main(void)
{
int i,max,tmp,high[10];
for(i=0;i<10;i++){
std::cin >> high[i];
}
for(i=0;i<3;i++){
for(j=1,max=high[0];j<10;j++){
if(max<high[j]){
max=high;
tmp=j;
}
}
high[tmp]=0;
std::cout << max << std::endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:21: error: 'j' was not declared in this scope
12 | for(j=1,max=high[0];j<10;j++){
| ^
a.cc:14:37: error: invalid conversion from 'int*' to 'int' [-fpermissive]
14 | max=high;
| ... |
s724407058 | p00001 | C++ | #include<iostream>
int main(void)
{
int i,j,max,tmp,high[10];
for(i=0;i<10;i++){
std::cin >> high[i];
}
for(i=0;i<3;i++){
for(j=1,max=high[0];j<10;j++){
if(max<high[j]){
max=high;
tmp=j;
}
}
high[tmp]=0;
std::cout << max << std::endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:37: error: invalid conversion from 'int*' to 'int' [-fpermissive]
14 | max=high;
| ^~~~
| |
| int*
|
s421941722 | p00001 | C++ | #include<iostream>
int main(void)
{
int i,j,max,tmp,high[10];
for(i=0;i<10;i++){
std::cin >> high[i];
}
for(i=0;i<3;i++){
for(j=1,max=high[0];j<10;j++){
if(max<high[j]){
max=high;
tmp=j;
}
}
high[tmp]=0;
std::cout << max << std::endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:37: error: invalid conversion from 'int*' to 'int' [-fpermissive]
14 | max=high;
| ^~~~
| |
| int*
|
s854460931 | p00001 | C++ | #include<iostream>
int main(void)
{
int i,j,max,tmp,high[10];
for(i=0;i<10;i++){
std::cin >> high[i];
}
for(i=0;i<3;i++){
for(j=1,tmp=1,max=high[0];j<10;j++){
if(max<high[j]){
max=high;
tmp=j;
}
}
high[tmp]=0;
std::cout << max << std::endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:37: error: invalid conversion from 'int*' to 'int' [-fpermissive]
14 | max=high;
| ^~~~
| |
| int*
|
s857564804 | p00001 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
vector<int> mountains;
for(int i= 0 ; i<10 ; i++){
int a;
cin>>a;
mountains.push_back(a);
}
for(int i=0 ; i<mountains.size()-1 ; i++){
for(int j=0 ; j<mountains.size()-1 ; j++){
if(mountains[j] < mountaians[j+1]){... | a.cc: In function 'int main()':
a.cc:19:43: error: 'mountaians' was not declared in this scope; did you mean 'mountains'?
19 | if(mountains[j] < mountaians[j+1]){
| ^~~~~~~~~~
| mountains
|
s553289458 | p00001 | C++ | #include<iostream>
int main(){
int a[10],i,j,n;
for(i=0,i<10,i++){
std::cin>>a[i];
}
for(i=0,i<10,i++){
for(j=i+1,j<10,j++){
if(a[i]<a[j]){
n=a[i];
a[i]=a[j];
a... | a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before ')' token
7 | for(i=0,i<10,i++){
| ^
| ;
a.cc:10:1: error: expected primary-expression before 'for'
10 | for(i=0,i<10,i++){
| ^~~
a.cc:9:28: error: expected ';' before 'for'
9 | ... |
s694547339 | p00001 | C++ | #include<iostream>
int main(){
int a[10],i,j,n;
for(i=0,i<10,i++){
std::cin>>a[i];
}
for(i=0,i<10,i++){
for(j=i+1,j<10,j++){
if(a[i]<a[j]){
n=a[i];
a[i]=a[j];
a... | a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before ')' token
7 | for(i=0,i<10,i++){
| ^
| ;
a.cc:10:1: error: expected primary-expression before 'for'
10 | for(i=0,i<10,i++){
| ^~~
a.cc:9:28: error: expected ';' before 'for'
9 | ... |
s400778673 | p00001 | C++ | #include<iosteam>
int main(){
int a[10], i, j ,n;
for(i=0;i<10;i++){
cin>>a[i];
}
for(i=0;i<10;i++){
for(j=i+1;j<10;j++){
if(a[i]<a[j]){
n=a[i];
a[i]=a[j];
a[j]=n;
}
}
}
for(i=0;i<3;i++){
cout<<a[i]<<endl;
}
return 0;
} | a.cc:1:9: fatal error: iosteam: No such file or directory
1 | #include<iosteam>
| ^~~~~~~~~
compilation terminated.
|
s059388528 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int nyuryoku,high,low,middle,flag;
for(int i=0;i<10;i++){
cin>>nyuryoku;
if(flag==0){
high = nyuryoku;
}else{
if(nyuryoku>low){
if(nyuryoku>middle){
if(nyuryoku>high){
high = nyuryoku;
}else{
middle = nyuryoku;
}low = nyuryoku;
}
}
}
... | a.cc: In function 'int main()':
a.cc:22:15: error: 'highendl' was not declared in this scope
22 | cout<<highendl<<endl;
| ^~~~~~~~
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s735453228 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int nyuryoku,high,low,middle,flag;
for(int i=0;i<10;i++){
cin>>nyuryoku;
if(flag==0){
high = nyuryoku;
}else{
if(nyuryoku>low){
if(nyuryoku>middle){
if(nyuryoku>high){
high = nyuryoku;
}else{
middle = nyuryoku;
}else{low = nyuryoku;
}
}
}... | a.cc: In function 'int main()':
a.cc:18:18: error: expected '}' before 'else'
18 | }else{low = nyuryoku;
| ^~~~
a.cc:13:36: note: to match this '{'
13 | if(nyuryoku>middle){
| ^
a.cc:22:15: error: 'highendl' was not de... |
s070005366 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int nyuryoku,high,low,middle,flag;
for(int i=0;i<10;i++){
cin>>nyuryoku;
if(flag==0){
high = nyuryoku;
}else{
if(nyuryoku>low){
if(nyuryoku>middle){
if(nyuryoku>high){
high = nyuryoku;
}else{
middle = nyuryoku;
}else{
low = nyuryoku;
... | a.cc: In function 'int main()':
a.cc:18:18: error: expected '}' before 'else'
18 | }else{
| ^~~~
a.cc:13:36: note: to match this '{'
13 | if(nyuryoku>middle){
| ^
a.cc:24:15: error: 'highendl' was not declared in this ... |
s638144753 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int nyuryoku,high,low,middle,flag;
for(int i=0;i<10;i++){
cin>>nyuryoku;
if(flag==0){
high = nyuryoku;
}else{
if(nyuryoku>low){
if(nyuryoku>middle){
if(nyuryoku>high){
high = nyuryoku;
}else{
middle = nyuryoku;
}else{
low = nyuryoku;
... | a.cc: In function 'int main()':
a.cc:18:18: error: expected '}' before 'else'
18 | }else{
| ^~~~
a.cc:13:36: note: to match this '{'
13 | if(nyuryoku>middle){
| ^
|
s248644805 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int nyuryoku,high,low,middle,flag;
for(int i=0;i<10;i++){
cin>>nyuryoku;
if(flag==0){
high = nyuryoku;
}else{
if(nyuryoku>low){
if(nyuryoku>middle){
if(nyuryoku>high){
high = nyuryoku;
}else
middle = nyuryoku
}else
low = nyuryoku;
}
... | a.cc: In function 'int main()':
a.cc:17:50: error: expected ';' before '}' token
17 | middle = nyuryoku
| ^
| ;
18 | }else
| ... |
s318610464 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int nyuryoku,high=0,low=0,middle=0,flag=0;
for(int i=0;i<10;i++){
cin>>nyuryoku;
if(flag==0){
high = nyuryoku;
flag++;
}else{
if(nyuryoku>low){
if(nyuryoku>middle){
if(nyuryoku>high){
high = nyuryoku;
}else
middle = nyuryoku
}else
low... | a.cc: In function 'int main()':
a.cc:18:50: error: expected ';' before '}' token
18 | middle = nyuryoku
| ^
| ;
19 | }else
| ... |
s693230184 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
int suchi,high=0,middle=0,low=0,i,flag=0,a,b,c;
for(i=0;i<10;i++){
cin>>suchi;
if(flag==0){
high = suchi;
flag++;
}
else{
if(suchi<low)
else if(suchi>=low&&suchi<middle)
low = suchi;
else if(suchi>=middle&&suchi<high){
... | a.cc: In function 'int main()':
a.cc:18:25: error: expected primary-expression before 'else'
18 | else if(suchi>=low&&suchi<middle)
| ^~~~
|
s676487770 | p00001 | C++ | #include <cstdio>
#include <vector>
using namespace std;
int main(void) {
vector<int> v;
for (int i = 0; i < 10; i++) {
int input;
scanf("%d", &input);
v.push_back(input);
}
sort(v.rbegin(), v.rend());
for (int i = 0; i < 3; i++) {
printf("%d\n", v[i]);
}
} | a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(v.rbegin(), v.rend());
| ^~~~
| short
|
s034150540 | p00001 | C++ | a = Array.new(4,0)
10.times do
a[3] = gets.chomp.to_i
3.times do |i|
if a[2-i]<a[3-i]
a[2-i], a[3-i] = a[3-i], a[2-i]
else
break
end
end
end
puts a[0]
puts a[1]
puts a[2] | a.cc:1:1: error: 'a' does not name a type
1 | a = Array.new(4,0)
| ^
|
s883958802 | p00001 | C++ | import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InutStreamReader(System.in));
int n=10;
int[] k=new int[n];
for(int i=0;i<n;i++){
k[i]=Integer.parseInt(br.readLine());
}
Arrays.sort(k);
for(int i=0;i<3;i++){
System.... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
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 java.util.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:7: ... |
s361491745 | p00001 | C++ | using namespace std;
int main()
{
int h[10],i,j,temp;
for(i=0; i<10; i++)
{
cin>>h[i];
}
for(i=0; i<10-1; i++)
{
for(j=i; j<10; j++)
{
if(h[i]<h[j])
{
temp=h[i];
h[i]=h[j];
h[j]=temp;
}
... | a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin>>h[i];
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:23:9: ... |
s768121652 | p00001 | C++ | int main()
{
std::vector<int> vec;
int a;
for(int i = 0; i < 10; ++i)
{
std::cin >> a;
vec.push_back(a);
}
std::sort(vec.begin(),vec.end());
for(int i = 0; i < 3; ++i) std::cout << vec.at(9-i) << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:14: error: 'vector' is not a member of 'std'
4 | std::vector<int> vec;
| ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
+++ |+#include <vector>
1 | int main()
a.cc:4:... |
s725178392 | p00001 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int a[10],i;
for(i=0;i<10;i++)cin>>a[i];
sort(a,a+10);
for(i=9;i>6;i--)cout<<a[i]<<endl;
return 0
} | a.cc: In function 'int main()':
a.cc:10:13: error: expected ';' before '}' token
10 | return 0
| ^
| ;
11 | }
| ~
|
s819568466 | p00001 | C++ | #include <iostream>
using namespace std;
int main() {
int 1st, 2nd, 3rd;
1st=0;
2nd=0;
3rd=0;
int i;
for(i=1;i<=10;i++){
if(height of mountain i > 3rd){
if(height of mountain i > 2nd){
if(height of mountain i > 1st){
1st=i;
}else{
2nd=i;
}
}else{
3rd=i;
}
}
}
cout << 1st ... | a.cc: In function 'int main()':
a.cc:5:13: error: expected unqualified-id before numeric constant
5 | int 1st, 2nd, 3rd;
| ^~~
a.cc:6:9: error: unable to find numeric literal operator 'operator""st'
6 | 1st=0;
| ^~~
a.cc:7:9: error: unable to find numeric literal ... |
s863436331 | p00001 | C++ | #include <iostream>
using namespace std;
int main() {
int first, second, third;
first=0;
second=0;
third=0;
int i;
for(i=1;i<=10;i++){
if(height of mountain i > third){
if(height of mountain i > second){
if(height of mountain i > first){
first=i;
}else{
second=i;
}
}else{
third=... | a.cc: In function 'int main()':
a.cc:11:20: error: 'height' was not declared in this scope
11 | if(height of mountain i > third){
| ^~~~~~
a.cc:11:26: error: expected ')' before 'of'
11 | if(height of mountain i > third){
| ~ ^~... |
s272673120 | p00001 | C++ | #include <iostream>
using namespace std;
int main() {
int first, second, third, input[10];
first=0;
second=0;
third=0;
cin >> input[0]
cin >> input[1]
cin >> input[2]
cin >> input[3]
cin >> input[4]
cin >> input[5]
cin >> input[6]
cin >> input[7]
cin >> input[8]
cin >> input[9]
int i;
for(i=0;i<=10;i++... | a.cc: In function 'int main()':
a.cc:9:24: error: expected ';' before 'cin'
9 | cin >> input[0]
| ^
| ;
10 | cin >> input[1]
| ~~~
a.cc:20:13: error: 'i' was not declared in this scope
20 | for(i=0;i<=... |
s946425593 | p00001 | C++ | #include<stdio.h>
int main (void){
int x1=0,x2=0,x3=0,input,s;
for(s=0;s<10;s++){
scanf("%d\n",&input);
if(x1 < input){
x3 = x2;
x2 = x1;
x1 = input;
}else{
if(x2 < input){
x3 = x2;
x2 = input;
}e... | a.cc: In function 'int main()':
a.cc:22:15: error: expected '}' at end of input
22 | return(0);
| ^
a.cc:2:16: note: to match this '{'
2 | int main (void){
| ^
|
s811286180 | p00001 | C++ | import java.util.Arrays;
class Main {
public static void main(String[] args) {
int n = 10, m = 3;
int[] arr = new int[n];
for (int i = 0; i < n; i++){
arr[i] = new java.util.Scanner(System.in).nextInt();
}
Arrays.sort(arr);
for (int i = n - 1; i >= n -m; i--){
System.out.printl... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Arrays;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:9: error: expected ':' before 'static'
4 | public static void main(String[] args) {
| ^~~~~~~
| :
a.cc:4:27: error: 'S... |
s762155511 | p00001 | C++ | #include <algorithm>
#include <stdio.h>
using namespace std;
int main()
{
int i[10];
cin >> i;
sort(i, i+10);
cout << i[1] << endl;
cout << i[2] << endl;
cout << i[3] << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
9 | cin >> i;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <stdio.h>
+++ |+#include <iostream>
3 | using ... |
s711467865 | p00001 | C++ | #include<iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
??????vector<int> data;
for(int i=0;i<10;i++)
{
int input;
cin>>input;
data.push_back(input);
}
sort(data.begin,data.end,grater<int>());
for(int i=0,i<3;i++)
{
cout... | a.cc: In function 'int main()':
a.cc:8:1: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:2: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:3: error: expected primary-expression before '?' token
8 | ??????vec... |
s108891353 | p00001 | C++ | #include<iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
??????vector<int> data;
for(int i=0;i<10;i++)
{
int input;
cin>>input;
data.push_back(input);
}
sort(data.begin,data.end,greater<int>());
for(int i=0,i<3;i++)
{
cou... | a.cc: In function 'int main()':
a.cc:8:1: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:2: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:3: error: expected primary-expression before '?' token
8 | ??????vec... |
s342707042 | p00001 | C++ | #include<iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
??????vector<int> data;
for(int i=0;i<10;i++)
{
int input;
cin>>input;
data.push_back(input);
}
sort(data.begin(),data.end(),greater<int>());
for(int i=0,i<3;i++)
{
... | a.cc: In function 'int main()':
a.cc:8:1: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:2: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:3: error: expected primary-expression before '?' token
8 | ??????vec... |
s572248925 | p00001 | C++ | #include<iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
int main(){
??????vector<int> data;
for(int i=0;i<10;i++)
{
int input;
cin>>input;
data.push_back(input);
}
sort(data.begin(),data.end(),greater<int>());
for(int i=0... | a.cc: In function 'int main()':
a.cc:9:1: error: expected primary-expression before '?' token
9 | ??????vector<int> data;
| ^
a.cc:9:2: error: expected primary-expression before '?' token
9 | ??????vector<int> data;
| ^
a.cc:9:3: error: expected primary-expression before '?' token
9 | ??????vec... |
s159032837 | p00001 | C++ | #include<iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
int main(){
??????vector<int> data;
for(int i=0;i<10;i++)
{
int input;
cin>>input;
data.push_back(input);
}
sort(data.begin(),data.end(),greater<int>());
for(int i=... | a.cc: In function 'int main()':
a.cc:10:1: error: expected primary-expression before '?' token
10 | ??????vector<int> data;
| ^
a.cc:10:2: error: expected primary-expression before '?' token
10 | ??????vector<int> data;
| ^
a.cc:10:3: error: expected primary-expression before '?' token
10 | ??????... |
s141274207 | p00001 | C++ | #include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(){
??????int data[10];
for(int i=0;i<10;i++)
{
cin>>data[i];
}
sort(data,data+10,greater<int>());
for(int i=0;i<3;i++)
{
cout<<data[i]<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:1: error: expected primary-expression before '?' token
8 | ??????int data[10];
| ^
a.cc:8:2: error: expected primary-expression before '?' token
8 | ??????int data[10];
| ^
a.cc:8:3: error: expected primary-expression before '?' token
8 | ??????int data[10... |
s375499871 | p00001 | C++ | #include<iostream>
using namespace std;
int main(){
??????int data[10];
for(int i=0;i<10;i++)
{
cin>>data[i];
}
for(int i=0;i<3;i++)
{
cout<<data[i]<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:1: error: expected primary-expression before '?' token
7 | ??????int data[10];
| ^
a.cc:7:2: error: expected primary-expression before '?' token
7 | ??????int data[10];
| ^
a.cc:7:3: error: expected primary-expression before '?' token
7 | ??????int data[10... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.