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] > top[0]){
top[3] = top[2];
top[2] = top[1];
top[1] = top[0];
top[0] = hills[i];
}else if (hills[i] > top[1]){
top[3] = top[2];
top[2] = top[1];
top[1] = hills[i];
}else if (hills[i] > top[2]){
top[2] = top[1];
top[1] = hills[i];
}
}
fprintf(stdout, "%d\n%d\n%d",top[0],top[1],top[2]);
return 0;
}
|
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(mountheight[i]>max[1]&&mountheight[i]!=max[0])
{
max[1]=mountheight[j];
}
}
for(i=1;i<10;i++)
{
if(mountheight[i]>max[2]&&mountheight[i]!=max[0]&&mountheight[i]!=max[1])
{
max[2]=mountheight[j];
}
}
cout<<max[0];
cout<<max[1];
cout<<max[2];
return 0;
}
|
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]!=max[0])
{
max[1] = mount[j];
}
}
for(i=1;i<10;i++)
{
if(mount[i]>max[2]&&mount[i]!=max[0]&&mount[i]!=max[1])
{
max[2] = mount[j];
}
}
cout << max[0] << endl;
cout << max[1] << endl;
cout << max[2] <<endl;
getch();
}
}
|
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[i];
}
}
for(i=1;i<10;i++)
{
if(mount[i]>max[2]&&mount[i]!=max[0]&&mount[i]!=max[1])
{
max[2] = mount[i];
}
}
cout << max[0] << endl;
cout << max[1] << endl;
cout << max[2] <<endl;
}
return 0;
}
|
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 global scope:
a.cc:40:1: error: expected unqualified-id before 'return'
40 | return 0;
| ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
41 | }
| ^
|
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 "<<heights[7]<<endl;
}
|
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/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:9: required from here
12 | sort(0,9);
| ~~~~^~~~~
/usr/include/c++/14/bits/stl_algo.h:1780:17: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
1780 | __val = _GLIBCXX_MOVE(*__i);
| ^~~~~
In file included from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1780:25: error: invalid type argument of unary '*' (have 'int')
1780 | __val = _GLIBCXX_MOVE(*__i);
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1782:15: error: invalid type argument of unary '*' (have 'int')
1782 | *__first = _GLIBCXX_MOVE(__val);
| ^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]':
/usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1777 | if (__comp(__i, __first))
| ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:9: required from here
12 | sort(0,9);
| ~~~~^~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:16: error: invalid type argument of unary '*' (have 'int')
45 | { return *__it1 < *__it2; }
| ^~~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:25: error: invalid type argument of unary '*' (have 'int')
45 | { return *__it1 < *__it2; }
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algo.h:61:
/usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1593 | std::__make_heap(__first, __middle, __comp);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1868 | std::__heap_select(__first, __middle, __last, __comp);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1884 | std::__partial_sort(__first, __last, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:9: required from here
12 | sort(0,9);
| ~~~~^~~~~
/usr/include/c++/14/bits/stl_heap.h:344:11: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
344 | _ValueType;
| ^~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:346:11: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
346 | _DistanceType;
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h: In instantiation of 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:1596:19: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1596 | std::__pop_heap(__first, __middle, __i, __comp);
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1868 | std::__heap_select(__first, __middle, __last, __comp);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1884 | std::__partial_sort(__first, __last, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1905:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4772:18: required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = int]'
4772 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:9: required from here
12 | sort(0,9);
| ~~~~^~~~~
/usr/include/c++/14/bits/stl_heap.h:258:9: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
258 | _ValueType;
| ^~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:260:9: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
260 | _DistanceType;
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:262:28: error: invalid type argument of unary '*' (have 'int')
262 | _ValueType __value = _GLIBCXX_MOVE(*__result);
| ^~~~~~~~~~~
|
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 ++ )
{
cout << vec.front()<<endl;
pop_heap(vec.begin(), vec.end());
vec.pop_back();
}
}
|
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; temp=0; num[k]=0; } return 0; }
| ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
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;
for(i=1;i<=9;i++){
for(j=1;j<=9;j++){
cout << i << "x" << j <<"=" <<i*j <<endl;
}
}
return 0;
}
|
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;
return 0;
}
|
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> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided
|
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++)
| ^~
| ;
a.cc:19:1: error: expected primary-expression before '}' token
19 | }
| ^
a.cc:18:6: error: expected ';' before '}' token
18 | }
| ^
| ;
19 | }
| ~
a.cc:19:1: error: expected primary-expression before '}' token
19 | }
| ^
a.cc:18:6: error: expected ')' before '}' token
18 | }
| ^
| )
19 | }
| ~
a.cc:15:8: note: to match this '('
15 | for(int i = 0; i < 3 : i++)
| ^
a.cc:19:1: error: expected primary-expression before '}' token
19 | }
| ^
|
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) << endl;
cout << heights.at(1) << endl;
cout << heights.at(2) << endl;
return 0;
}
|
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::basic_istream<char>'} and 'int [10]')
9 | cin >> h;
| ~~~ ^~ ~
| | |
| | int [10]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
9 | cin >> h;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(short int)((int*)(& h))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(short unsigned int)((int*)(& h))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(int)((int*)(& h))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(unsigned int)((int*)(& h))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(long int)((int*)(& h))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(long unsigned int)((int*)(& h))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(long long int)((int*)(& h))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(long long unsigned int)((int*)(& h))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
9 | cin >> h;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [10]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [10]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [10]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [10]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [10]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_typ
|
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::basic_istream<char>'} and 'int [10]')
9 | cin >> h;
| ~~~ ^~ ~
| | |
| | int [10]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
9 | cin >> h;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(short int)((int*)(& h))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(short unsigned int)((int*)(& h))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(int)((int*)(& h))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(unsigned int)((int*)(& h))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(long int)((int*)(& h))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(long unsigned int)((int*)(& h))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(long long int)((int*)(& h))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
9 | cin >> h;
| ^
| |
| int*
a.cc:9:10: error: cannot bind rvalue '(long long unsigned int)((int*)(& h))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:10: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
9 | cin >> h;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [10]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [10]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [10]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [10]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [10]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_typ
|
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::basic_istream<char>'} and 'int [10]')
9 | std::cin >> h;
| ~~~~~~~~ ^~ ~
| | |
| | int [10]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
9 | std::cin >> h;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(short int)((int*)(& h))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(short unsigned int)((int*)(& h))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(int)((int*)(& h))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(unsigned int)((int*)(& h))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(long int)((int*)(& h))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(long unsigned int)((int*)(& h))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(long long int)((int*)(& h))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(long long unsigned int)((int*)(& h))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
9 | std::cin >> h;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [10]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [10]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [10]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [10]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [10]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 |
|
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::basic_istream<char>'} and 'int [10]')
9 | std::cin >> h;
| ~~~~~~~~ ^~ ~
| | |
| | int [10]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*'
9 | std::cin >> h;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'short int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(short int)((int*)(& h))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(short unsigned int)((int*)(& h))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(int)((int*)(& h))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(unsigned int)((int*)(& h))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'long int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(long int)((int*)(& h))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(long unsigned int)((int*)(& h))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'long long int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(long long int)((int*)(& h))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive]
9 | std::cin >> h;
| ^
| |
| int*
a.cc:9:15: error: cannot bind rvalue '(long long unsigned int)((int*)(& h))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:9:15: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
9 | std::cin >> h;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [10]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [10]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [10]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [10]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [10]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 |
|
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(TopOfThree[i] < height[j])
{
TopOfThree[i] = height[j];
index = j;
}
}
for(int k = index;k < 10;k++)
{
if(k == 9)
height[k] = 0;
else
height[k] = height[k + 1];
}
}
cout << TopOfThree[0] << endl << TopOfThree[1] << endl << TopOfThree[2] << endl;
return 0;
}
|
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);
System.out.println(h[9]);
System.out.println(h[8]);
System.out.println(h[7]);
}
}
|
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-ts'
a.cc:5:11: error: expected ':' before 'static'
5 | public static void main(String args[]){
| ^~~~~~~
| :
a.cc:5:29: error: 'String' has not been declared
5 | public static void main(String args[]){
| ^~~~~~
a.cc:16:2: error: expected ';' after class definition
16 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:6:12: error: structured binding declaration cannot have type 'int'
6 | int[] h = new int[10];
| ^~
a.cc:6:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:12: error: empty structured binding declaration
a.cc:6:15: error: expected initializer before 'h'
6 | int[] h = new int[10];
| ^
a.cc:7:9: error: 'Scanner' was not declared in this scope
7 | Scanner scan = new Scanner(System.in);
| ^~~~~~~
a.cc:9:13: error: 'h' was not declared in this scope
9 | h[i] = Integer.parseInt(scan.next());
| ^
a.cc:9:20: error: 'Integer' was not declared in this scope
9 | h[i] = Integer.parseInt(scan.next());
| ^~~~~~~
a.cc:9:37: error: 'scan' was not declared in this scope
9 | h[i] = Integer.parseInt(scan.next());
| ^~~~
a.cc:11:9: error: 'Arrays' was not declared in this scope
11 | Arrays.sort(h);
| ^~~~~~
a.cc:11:21: error: 'h' was not declared in this scope
11 | Arrays.sort(h);
| ^
a.cc:12:9: error: 'System' was not declared in this scope
12 | System.out.println(h[9]);
| ^~~~~~
|
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],imain(){ for(;i<10;scanf("%d",a+i++)); sort(a,a+10);for(;i>7;printf("%d\n",a+--i));return 0;}
| ^~~~~~~~~~~~
compilation terminated.
|
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;main(){ for(;i<10;scanf("%d",a+i++)); sort(a,a+10);for(;i>7;printf("%d\n",a+--i));return 0;}
| ^~~~~~~~~~~~
compilation terminated.
|
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],imain(){ for(;i<10;scanf("%d",a+i++)); sort(a,a+10);for(;i>7;printf("%d\n",a+(--i)));return 0;}
| ^~~~~~~~~~~~
compilation terminated.
|
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( vec );
for ( int i = 0; i < 3; ++i )
{
System.out.println( vec.get(i) );
}
}
}
|
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: expected ',' or '...' before 'av'
4 | public static void main(String[] av)
| ^~
a.cc:19:2: error: expected ';' after class definition
19 | }
| ^
| ;
a.cc: In static member function 'static void q2::main(int*)':
a.cc:6:17: error: 'java' was not declared in this scope
6 | java.util.Scanner sc = new java.util.Scanner(System.in);
| ^~~~
a.cc:7:37: error: 'Integer' was not declared in this scope
7 | java.util.ArrayList<Integer> vec = new java.util.ArrayList<Integer>();
| ^~~~~~~
a.cc:7:46: error: 'vec' was not declared in this scope
7 | java.util.ArrayList<Integer> vec = new java.util.ArrayList<Integer>();
| ^~~
a.cc:7:56: error: 'java' does not name a type
7 | java.util.ArrayList<Integer> vec = new java.util.ArrayList<Integer>();
| ^~~~
a.cc:8:24: error: 'sc' was not declared in this scope
8 | while( sc.hasNextInt() )
| ^~
a.cc:16:25: error: 'System' was not declared in this scope
16 | System.out.println( vec.get(i) );
| ^~~~~~
|
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( vec );
for ( int i = 0; i < 3; ++i )
{
System.out.println( vec.get(i) );
}
}
}
|
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: expected ',' or '...' before 'av'
4 | public static void main(String[] av)
| ^~
a.cc:19:2: error: expected ';' after class definition
19 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:6:17: error: 'java' was not declared in this scope
6 | java.util.Scanner sc = new java.util.Scanner(System.in);
| ^~~~
a.cc:7:37: error: 'Integer' was not declared in this scope
7 | java.util.ArrayList<Integer> vec = new java.util.ArrayList<Integer>();
| ^~~~~~~
a.cc:7:46: error: 'vec' was not declared in this scope
7 | java.util.ArrayList<Integer> vec = new java.util.ArrayList<Integer>();
| ^~~
a.cc:7:56: error: 'java' does not name a type
7 | java.util.ArrayList<Integer> vec = new java.util.ArrayList<Integer>();
| ^~~~
a.cc:8:24: error: 'sc' was not declared in this scope
8 | while( sc.hasNextInt() )
| ^~
a.cc:16:25: error: 'System' was not declared in this scope
16 | System.out.println( vec.get(i) );
| ^~~~~~
|
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[7] << std::endl;
}
|
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[7] << std::endl;
}
|
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++){
  printf("%d\n", height[i]);
 }
   
 return 0;
}
|
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: error: stray '#' in program
8 |    
| ^
a.cc:8:8: error: stray '#' in program
8 |    
| ^
a.cc:8:14: error: stray '#' in program
8 |    
| ^
a.cc:9:2: error: stray '#' in program
9 |  int i, height[10];
| ^
a.cc:10:2: error: stray '#' in program
10 |  for(i=0;i<10;i++){
| ^
a.cc:11:2: error: stray '#' in program
11 |   scanf("%d", &height[i]);
| ^
a.cc:11:8: error: stray '#' in program
11 |   scanf("%d", &height[i]);
| ^
a.cc:12:2: error: stray '#' in program
12 |  }
| ^
a.cc:13:2: error: stray '#' in program
13 |  sort(height, height+10, greater<int>());
| ^
a.cc:14:2: error: stray '#' in program
14 |    
| ^
a.cc:14:8: error: stray '#' in program
14 |    
| ^
a.cc:14:14: error: stray '#' in program
14 |    
| ^
a.cc:15:2: error: stray '#' in program
15 |  for(i=0;i<3;i++){
| ^
a.cc:16:2: error: stray '#' in program
16 |   printf("%d\n", height[i]);
| ^
a.cc:16:8: error: stray '#' in program
16 |   printf("%d\n", height[i]);
| ^
a.cc:17:2: error: stray '#' in program
17 |  }
| ^
a.cc:18:2: error: stray '#' in program
18 |    
| ^
a.cc:18:8: error: stray '#' in program
18 |    
| ^
a.cc:18:14: error: stray '#' in program
18 |    
| ^
a.cc:19:2: error: stray '#' in program
19 |  return 0;
| ^
a.cc:4:3: error: expected unqualified-id before numeric constant
4 |  
| ^~~
a.cc:6:3: error: expected unqualified-id before numeric constant
6 |    
| ^~~
a.cc:6:9: error: expected unqualified-id before numeric constant
6 |    
| ^~~
a.cc:6:15: error: expected unqualified-id before numeric constant
6 |    
| ^~~
a.cc: In function 'int main()':
a.cc:8:3: error: lvalue required as unary '&' operand
8 |    
| ^~~
a.cc:8:9: error: lvalue required as unary '&' operand
8 |    
| ^~~
a.cc:8:15: error: lvalue required as unary '&' operand
8 |    
| ^~~
a.cc:9:3: error: lvalue required as unary '&' operand
9 |  int i, height[10];
| ^~~
a.cc:10:3: error: lvalue required as unary '&' operand
10 |  for(i=0;i<10;i++){
| ^~~
a.cc:11:3: error: lvalue required as unary '&' operand
11 |   scanf("%d", &height[i]);
| ^~~
a.cc:11:9: error: lvalue required as unary '&' operand
11 |   scanf("%d", &height[i]);
| ^~~
a.cc:12:3: error: lvalue required as unary '&' operand
12 |  }
| ^~~
a.cc:13:3: error: lvalue required as unary '&' operand
13 |  sort(height, height+10, greater<int>());
| ^~~
a.cc:14:3: error: lvalue required as unary '&' operand
14 |    
| ^~~
a.cc:14:9: error: lvalue required as unary '&' operand
14 |    
| ^~~
a.cc:14:15: error: lvalue required as unary '&' operand
14 |    
| ^~~
a.cc:15:3: error: lvalue required as unary '&' operand
15 |  for(i=0;i<3;i++){
| ^~~
a.cc:16:3: error: lvalue required as unary '&' operand
16 |   printf("%d\n", height[i]);
| ^~~
a.cc:16:9: error: lvalue required as unary '&' operand
16 |   printf("%d\n", height[i]);
| ^~~
a.cc:17:3: error: lvalue required as unary '&' operand
17 |  }
| ^~~
a.cc:18:3: error: lvalue required as unary '&' operand
18 |    
| ^~~
a.cc:18:9: error: lvalue required as unary '&' operand
18 |    
| ^~~
a.cc:18:15: error: lvalue required as unary '&' operand
18 |    
| ^~~
a.cc:19:3: error: lvalue required as unary '&' operand
19 |  return 0;
| ^~~
|
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;
}
return 0;
}
|
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: expected ')' before ';' token
6 | for(int i=0,int h=0;i<10;i++){
| ~ ^
| )
a.cc:6:30: error: 'i' was not declared in this scope
6 | for(int i=0,int h=0;i<10;i++){
| ^
|
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;
}
return 0;
}
|
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;
}
return 0;
}
|
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;i<=9;i++){
cout << m[i] <<'\n';
}
return 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 < heights[i]) {
temp_result = heights[i];
index = i;
}
}
std::cout << temp_result << std::endl;
}
return 0;
}
|
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>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #Include <iostream>
a.cc:21:1: error: 'cout' was not declared in this scope
21 | cout << R[i] << endl;
| ^~~~
a.cc:21:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:17: error: 'endl' was not declared in this scope
21 | cout << R[i] << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #Include <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];
}
else if(third <= high[i])
third = high[i];
}
cout << first << endl << second << endl << third << endl;
return 0;
}
|
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];
work[j] = temp;
}
}
}
for(int i = 0; i < 3; i++){
cout << work[i] << endl;
}
return 0;
}
|
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];
work[j] = temp;
}
}
}
for(int i = 0; i < 3; i++){
cout << work[i] << endl;
}
return 0;
}
|
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];
work[j] = temp;
}
}
}
for(int i = 0; i < 3; i++){
cout << work[i] << endl;
}
return 0;
}
|
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++){
cout << input[i] << endl;
}
return 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+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; i < 3; i++){
cout << input[i] << endl;
}
return 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; i < 3; i++){
cout << input[i] << endl;
}
return 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 __name__ == '__main__':
| ^~
|
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]){
top[j-1] = buf;
top[j-1] = top[j];
top[j] = buf;
j--;
}else{
break;
}
}
}
}
for(i = 0; i<3; i++)
cout << top[i] << '\n';
return 0;
}
|
a.cc:1:1: error: 'File' does not name a type
1 | File Edit Options Buffers Tools C++ Help
| ^~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
|
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;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
}
return s;
}
int thi(const int *h){
int i,f,s,t;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
s>=h[i] && t<h[i] ? t=h[i] : /*処理無し*/;
}
return t;
}
|
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 declared in this scope
11 | printf("%d",thi(h));
| ^~~
a.cc: In function 'int fir(const int*)':
a.cc:18:47: error: expected primary-expression before ';' token
18 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc: In function 'int sec(const int*)':
a.cc:26:47: error: expected primary-expression before ';' token
26 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc:29:58: error: expected primary-expression before ';' token
29 | f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
| ^
a.cc: In function 'int thi(const int*)':
a.cc:37:47: error: expected primary-expression before ';' token
37 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc:40:58: error: expected primary-expression before ';' token
40 | f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
| ^
a.cc:43:58: error: expected primary-expression before ';' token
43 | s>=h[i] && t<h[i] ? t=h[i] : /*処理無し*/;
| ^
|
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] : /*処理無し*/;
}
return f;
}
int sec(const int *h){
int i,f,s;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
}
return s;
}
int thi(const int *h){
int i,f,s,t;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
s>=h[i] && t<h[i] ? t=h[i] : /*処理無し*/;
}
return t;
}
|
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
30 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc:33:58: error: expected primary-expression before ';' token
33 | f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
| ^
a.cc: In function 'int thi(const int*)':
a.cc:41:47: error: expected primary-expression before ';' token
41 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc:44:58: error: expected primary-expression before ';' token
44 | f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
| ^
a.cc:47:58: error: expected primary-expression before ';' token
47 | s>=h[i] && t<h[i] ? t=h[i] : /*処理無し*/;
| ^
|
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] : /*処理無し*/;
}
return f;
}
int sec(const int *h){
int i,f,s;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
}
return s;
}
int thi(const int *h){
int i,f,s,t;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
s>=h[i] && t<h[i] ? t=h[i] : /*処理無し*/;
}
return t;
}
|
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
30 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc:33:58: error: expected primary-expression before ';' token
33 | f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
| ^
a.cc: In function 'int thi(const int*)':
a.cc:41:47: error: expected primary-expression before ';' token
41 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc:44:58: error: expected primary-expression before ';' token
44 | f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
| ^
a.cc:47:58: error: expected primary-expression before ';' token
47 | s>=h[i] && t<h[i] ? t=h[i] : /*処理無し*/;
| ^
|
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] : /*処理無し*/;
}
return f;
}
int sec(const int *h){
int i,f,s;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
}
return s;
}
int thi(const int *h){
int i,f,s,t;
for(i=0;i<10;i++){
f<h[i] ? f=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
}
for(i=0;i<10;i++){
s>=h[i] && t<h[i] ? t=h[i] : /*処理無し*/;
}
return t;
}
|
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
30 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc:33:58: error: expected primary-expression before ';' token
33 | f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
| ^
a.cc: In function 'int thi(const int*)':
a.cc:41:47: error: expected primary-expression before ';' token
41 | f<h[i] ? f=h[i] : /*処理無し*/;
| ^
a.cc:44:58: error: expected primary-expression before ';' token
44 | f>=h[i] && s<h[i] ? s=h[i] : /*処理無し*/;
| ^
a.cc:47:58: error: expected primary-expression before ';' token
47 | s>=h[i] && t<h[i] ? t=h[i] : /*処理無し*/;
| ^
|
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 | scanf("%d",&a[i]);
| ^
a.cc:10:37: error: invalid types 'int[int]' for array subscript
10 | if(a[j]<a[j+1]){
| ^
a.cc:10:42: error: invalid types 'int[int]' for array subscript
10 | if(a[j]<a[j+1]){
| ^
a.cc:11:52: error: invalid types 'int[int]' for array subscript
11 | int temp =a[j];
| ^
a.cc:12:42: error: invalid types 'int[int]' for array subscript
12 | a[j]=a[j+1];
| ^
a.cc:12:47: error: invalid types 'int[int]' for array subscript
12 | a[j]=a[j+1];
| ^
a.cc:13:42: error: invalid types 'int[int]' for array subscript
13 | a[j+1]=temp;
| ^
a.cc:18:64: error: invalid types 'int[int]' for array subscript
18 | printf("%d\n",a[i]);
| ^
a.cc:20:58: error: expected '}' at end of input
20 | return 0;
| ^
a.cc:2:11: note: to match this '{'
2 | int main(){
| ^
|
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 | scanf("%d",&a[i]);
| ^
a.cc:12:37: error: invalid types 'int[int]' for array subscript
12 | if(a[j]<a[j+1]){
| ^
a.cc:12:42: error: invalid types 'int[int]' for array subscript
12 | if(a[j]<a[j+1]){
| ^
a.cc:13:52: error: invalid types 'int[int]' for array subscript
13 | int temp =a[j];
| ^
a.cc:14:42: error: invalid types 'int[int]' for array subscript
14 | a[j]=a[j+1];
| ^
a.cc:14:47: error: invalid types 'int[int]' for array subscript
14 | a[j]=a[j+1];
| ^
a.cc:15:42: error: invalid types 'int[int]' for array subscript
15 | a[j+1]=temp;
| ^
a.cc:20:64: error: invalid types 'int[int]' for array subscript
20 | printf("%d\n",a[i]);
| ^
a.cc:22:58: error: expected '}' at end of input
22 | return 0;
| ^
a.cc:2:11: note: to match this '{'
2 | int main(){
| ^
|
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.readline());
arrays.sort(arr);
for (int i = 0; i < 3; i++)
system.out.println(arr[i]);
}
}
|
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 with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.arrays;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:9: error: expected ':' before 'static'
6 | public static void main(string[] a){
| ^~~~~~~
| :
a.cc:6:27: error: 'string' has not been declared
6 | public static void main(string[] a){
| ^~~~~~
a.cc:6:36: error: expected ',' or '...' before 'a'
6 | public static void main(string[] a){
| ^
a.cc:16:2: error: expected ';' after class definition
16 | }
| ^
| ;
a.cc: In static member function 'static void aoj001::main(int*)':
a.cc:7:5: error: 'bufferedreader' was not declared in this scope
7 | bufferedreader br = new bufferedreader(new inputstreamreader(system.in));
| ^~~~~~~~~~~~~~
a.cc:8:8: error: structured binding declaration cannot have type 'int'
8 | int[] arr = new int[10];
| ^~
a.cc:8:8: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:8:8: error: empty structured binding declaration
a.cc:8:11: error: expected initializer before 'arr'
8 | int[] arr = new int[10];
| ^~~
a.cc:10:7: error: 'arr' was not declared in this scope
10 | arr[i] = integer.parseint(br.readline());
| ^~~
a.cc:10:16: error: 'integer' was not declared in this scope
10 | arr[i] = integer.parseint(br.readline());
| ^~~~~~~
a.cc:10:33: error: 'br' was not declared in this scope
10 | arr[i] = integer.parseint(br.readline());
| ^~
a.cc:12:5: error: 'arrays' was not declared in this scope
12 | arrays.sort(arr);
| ^~~~~~
a.cc:12:17: error: 'arr' was not declared in this scope
12 | arrays.sort(arr);
| ^~~
a.cc:14:7: error: 'system' was not declared in this scope
14 | system.out.println(arr[i]);
| ^~~~~~
|
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.readline());
arrays.sort(arr);
for (int i = 0; i < 3; i++)
system.out.println(arr[i]);
}
}
|
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 with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.arrays;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:9: error: expected ':' before 'static'
6 | public static void main(string[] a){
| ^~~~~~~
| :
a.cc:6:27: error: 'string' has not been declared
6 | public static void main(string[] a){
| ^~~~~~
a.cc:6:36: error: expected ',' or '...' before 'a'
6 | public static void main(string[] a){
| ^
a.cc:16:2: error: expected ';' after class definition
16 | }
| ^
| ;
a.cc: In static member function 'static void aoj001::main(int*)':
a.cc:7:5: error: 'BufferedReader' was not declared in this scope
7 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
| ^~~~~~~~~~~~~~
a.cc:8:8: error: structured binding declaration cannot have type 'int'
8 | int[] arr = new int[10];
| ^~
a.cc:8:8: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:8:8: error: empty structured binding declaration
a.cc:8:11: error: expected initializer before 'arr'
8 | int[] arr = new int[10];
| ^~~
a.cc:10:7: error: 'arr' was not declared in this scope
10 | arr[i] = integer.parseint(br.readline());
| ^~~
a.cc:10:16: error: 'integer' was not declared in this scope
10 | arr[i] = integer.parseint(br.readline());
| ^~~~~~~
a.cc:10:33: error: 'br' was not declared in this scope
10 | arr[i] = integer.parseint(br.readline());
| ^~
a.cc:12:5: error: 'arrays' was not declared in this scope
12 | arrays.sort(arr);
| ^~~~~~
a.cc:12:17: error: 'arr' was not declared in this scope
12 | arrays.sort(arr);
| ^~~
a.cc:14:7: error: 'system' was not declared in this scope
14 | system.out.println(arr[i]);
| ^~~~~~
|
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++){
if(number[count]<number[count+1]){
temp=number[count];
number[count]=number[count+1];
number[count+1]=tempa;
}
}
flag++;
}
for(count=0;count<3;count++){
cout<<number[count]<<endl;
}
}
|
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]<<"\n"<<mountain[2]<<"\n";
return 0;
}
|
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'?
13 | mountain[k]=montain[k+1];
| ^~~~~~~
| mountain
a.cc:18:34: error: 'moutnain' was not declared in this scope; did you mean 'mountain'?
18 | cout<<mountain[0]<<"\n"<<moutnain[1]<<"\n"<<mountain[2]<<"\n";
| ^~~~~~~~
| 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;
| ^~~~
| |
| int*
|
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]){
int tmp;
tmp = mountains[j];
mountains[j] = mountains[j+1];
mountains[j+1] = tmp;
}
}
}
for(int i ; i<3 ; i++){
cout<<mountains[i]<<endl;
}
return 0;
}
|
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[j]=n;
}
}
}
for(i=0,i<3,i++){
std::cout<<a[i]<<std::endl;
}
return 0;
}
|
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 | }
| ^
| ;
10 | 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 | }
| ^
| )
10 | for(i=0,i<10,i++){
| ~~~
a.cc:7:4: note: to match this '('
7 | for(i=0,i<10,i++){
| ^
a.cc:10:17: error: expected ';' before ')' token
10 | for(i=0,i<10,i++){
| ^
| ;
a.cc:19:1: error: expected primary-expression before 'for'
19 | for(i=0,i<3,i++){
| ^~~
a.cc:18:2: error: expected ';' before 'for'
18 | }
| ^
| ;
19 | for(i=0,i<3,i++){
| ~~~
a.cc:19:1: error: expected primary-expression before 'for'
19 | for(i=0,i<3,i++){
| ^~~
a.cc:18:2: error: expected ')' before 'for'
18 | }
| ^
| )
19 | for(i=0,i<3,i++){
| ~~~
a.cc:10:4: note: to match this '('
10 | for(i=0,i<10,i++){
| ^
a.cc:19:16: error: expected ';' before ')' token
19 | for(i=0,i<3,i++){
| ^
| ;
a.cc:22:1: error: expected primary-expression before 'return'
22 | return 0;
| ^~~~~~
a.cc:21:13: error: expected ';' before 'return'
21 | }
| ^
| ;
22 | return 0;
| ~~~~~~
a.cc:22:1: error: expected primary-expression before 'return'
22 | return 0;
| ^~~~~~
a.cc:21:13: error: expected ')' before 'return'
21 | }
| ^
| )
22 | return 0;
| ~~~~~~
a.cc:19:4: note: to match this '('
19 | for(i=0,i<3,i++){
| ^
|
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[j]=n;
}
}
}
for(i=0,i<3,i++){
std::cout<<a[i]<<std::endl;
}
return 0;
}
|
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 | }
| ^
| ;
10 | 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 | }
| ^
| )
10 | for(i=0,i<10,i++){
| ~~~
a.cc:7:4: note: to match this '('
7 | for(i=0,i<10,i++){
| ^
a.cc:10:17: error: expected ';' before ')' token
10 | for(i=0,i<10,i++){
| ^
| ;
a.cc:19:1: error: expected primary-expression before 'for'
19 | for(i=0,i<3,i++){
| ^~~
a.cc:18:2: error: expected ';' before 'for'
18 | }
| ^
| ;
19 | for(i=0,i<3,i++){
| ~~~
a.cc:19:1: error: expected primary-expression before 'for'
19 | for(i=0,i<3,i++){
| ^~~
a.cc:18:2: error: expected ')' before 'for'
18 | }
| ^
| )
19 | for(i=0,i<3,i++){
| ~~~
a.cc:10:4: note: to match this '('
10 | for(i=0,i<10,i++){
| ^
a.cc:19:16: error: expected ';' before ')' token
19 | for(i=0,i<3,i++){
| ^
| ;
a.cc:22:1: error: expected primary-expression before 'return'
22 | return 0;
| ^~~~~~
a.cc:21:13: error: expected ';' before 'return'
21 | }
| ^
| ;
22 | return 0;
| ~~~~~~
a.cc:22:1: error: expected primary-expression before 'return'
22 | return 0;
| ^~~~~~
a.cc:21:13: error: expected ')' before 'return'
21 | }
| ^
| )
22 | return 0;
| ~~~~~~
a.cc:19:4: note: to match this '('
19 | for(i=0,i<3,i++){
| ^
|
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;
}
}
}
cout<<highendl<<endl;
cout<<middle<<endl;
cout<<low<<endl;
return 0;
}
|
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;
}
}
}
cout<<highendl<<endl;
cout<<middle<<endl;
cout<<low<<endl;
return 0;
}
|
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 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(){
| ^
|
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;
}
}
}
}
cout<<highendl<<endl;
cout<<middle<<endl;
cout<<low<<endl;
return 0;
}
|
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 scope
24 | cout<<highendl<<endl;
| ^~~~~~~~
|
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;
}
}
}
}
cout<<high<<endl;
cout<<middle<<endl;
cout<<low<<endl;
return 0;
}
|
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;
}
}
}
cout<<high<<endl;
cout<<middle<<endl;
cout<<low<<endl;
return 0;
}
|
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 = nyuryoku;
}
}
}
cout<<high<<endl;
cout<<middle<<endl;
cout<<low<<endl;
return 0;
}
|
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){
low = middle;
middle = suchi;
}
else{
low = middle;
middle = high;
high = suchi;
}
}
}
cout<<high<<endl;
cout<<middle<<endl;
cout<<low<<endl;
return 0;
}
|
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.out.println(k[n-i-1]);
}
}
}
|
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: error: expected ':' before 'static'
5 | public static void main(String[] args) throws IOException{
| ^~~~~~~
| :
a.cc:5:25: error: 'String' has not been declared
5 | public static void main(String[] args) throws IOException{
| ^~~~~~
a.cc:5:34: error: expected ',' or '...' before 'args'
5 | public static void main(String[] args) throws IOException{
| ^~~~
a.cc:5:38: error: expected ';' at end of member declaration
5 | public static void main(String[] args) throws IOException{
| ^
| ;
a.cc:5:40: error: 'throws' does not name a type
5 | public static void main(String[] args) throws IOException{
| ^~~~~~
a.cc:17:2: error: expected ';' after class definition
17 | }
| ^
| ;
|
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;
}
}
}
for(i=0; i<3; i++)
{
cout<<h[i]<<endl;
}
}
|
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: error: 'cout' was not declared in this scope
23 | cout<<h[i]<<endl;
| ^~~~
a.cc:23:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:21: error: 'endl' was not declared in this scope
23 | cout<<h[i]<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
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:21: error: expected primary-expression before 'int'
4 | std::vector<int> vec;
| ^~~
a.cc:9:22: error: 'cin' is not a member of 'std'
9 | std::cin >> a;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | int main()
a.cc:10:17: error: 'vec' was not declared in this scope
10 | vec.push_back(a);
| ^~~
a.cc:13:14: error: 'sort' is not a member of 'std'
13 | std::sort(vec.begin(),vec.end());
| ^~~~
a.cc:13:19: error: 'vec' was not declared in this scope
13 | std::sort(vec.begin(),vec.end());
| ^~~
a.cc:15:41: error: 'cout' is not a member of 'std'
15 | for(int i = 0; i < 3; ++i) std::cout << vec.at(9-i) << std::endl;
| ^~~~
a.cc:15:41: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:69: error: 'endl' is not a member of 'std'
15 | for(int i = 0; i < 3; ++i) std::cout << vec.at(9-i) << std::endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | int main()
|
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 << endl;
cout << 2nd << endl;
cout << 3rd << endl;
return 0;
}
|
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 operator 'operator""nd'
7 | 2nd=0;
| ^~~
a.cc:8:9: error: unable to find numeric literal operator 'operator""rd'
8 | 3rd=0;
| ^~~
a.cc:11:20: error: 'height' was not declared in this scope
11 | if(height of mountain i > 3rd){
| ^~~~~~
a.cc:11:26: error: expected ')' before 'of'
11 | if(height of mountain i > 3rd){
| ~ ^~~
| )
a.cc:12:34: error: expected ')' before 'of'
12 | if(height of mountain i > 2nd){
| ~ ^~~
| )
a.cc:13:42: error: expected ')' before 'of'
13 | if(height of mountain i > 1st){
| ~ ^~~
| )
a.cc:14:41: error: unable to find numeric literal operator 'operator""st'
14 | 1st=i;
| ^~~
a.cc:16:41: error: unable to find numeric literal operator 'operator""nd'
16 | 2nd=i;
| ^~~
a.cc:19:33: error: unable to find numeric literal operator 'operator""rd'
19 | 3rd=i;
| ^~~
a.cc:23:17: error: unable to find numeric literal operator 'operator""st'
23 | cout << 1st << endl;
| ^~~
a.cc:24:17: error: unable to find numeric literal operator 'operator""nd'
24 | cout << 2nd << endl;
| ^~~
a.cc:25:17: error: unable to find numeric literal operator 'operator""rd'
25 | cout << 3rd << endl;
| ^~~
|
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=i;
}
}
}
cout << first << endl;
cout << second << endl;
cout << third << endl;
return 0;
}
|
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){
| ~ ^~~
| )
a.cc:12:34: error: expected ')' before 'of'
12 | if(height of mountain i > second){
| ~ ^~~
| )
a.cc:13:42: error: expected ')' before 'of'
13 | if(height of mountain i > first){
| ~ ^~~
| )
|
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++){
if(input[i] > third){
if(input[i] > second){
if(input[i] > first){
first=input[i];
}else{
second=input[i];
}
}else{
third=input[i];
}
}
}
cout << first << endl;
cout << second << endl;
cout << third << endl;
return 0;
}
|
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<=10;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;
}else{
if(x3 < input){
x3 = input;
}
}
}
}
printf("%d\n%d\n%d\n",x1,x2,x3);
return(0);
|
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.println(arr[i]);
}
}
}
|
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: 'String' has not been declared
4 | public static void main(String[] args) {
| ^~~~~~
a.cc:4:36: error: expected ',' or '...' before 'args'
4 | public static void main(String[] args) {
| ^~~~
a.cc:18:2: error: expected ';' after class definition
18 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:6:8: error: structured binding declaration cannot have type 'int'
6 | int[] arr = new int[n];
| ^~
a.cc:6:8: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:8: error: empty structured binding declaration
a.cc:6:11: error: expected initializer before 'arr'
6 | int[] arr = new int[n];
| ^~~
a.cc:9:7: error: 'arr' was not declared in this scope
9 | arr[i] = new java.util.Scanner(System.in).nextInt();
| ^~~
a.cc:9:20: error: 'java' does not name a type
9 | arr[i] = new java.util.Scanner(System.in).nextInt();
| ^~~~
a.cc:12:5: error: 'Arrays' was not declared in this scope
12 | Arrays.sort(arr);
| ^~~~~~
a.cc:12:17: error: 'arr' was not declared in this scope
12 | Arrays.sort(arr);
| ^~~
a.cc:15:7: error: 'System' was not declared in this scope
15 | System.out.println(arr[i]);
| ^~~~~~
|
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 namespace std;
a.cc:11:9: error: 'cout' was not declared in this scope
11 | cout << i[1] << endl;
| ^~~~
a.cc:11:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:25: error: 'endl' was not declared in this scope
11 | cout << i[1] << endl;
| ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
2 | #include <stdio.h>
+++ |+#include <ostream>
3 | using namespace std;
|
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<<data[i]<<endl;
}
return 0;
}
|
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 | ??????vector<int> data;
| ^
a.cc:8:4: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:5: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:6: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:19: error: expected primary-expression before 'data'
8 | ??????vector<int> data;
| ^~~~
a.cc:8:18: error: expected ':' before 'data'
8 | ??????vector<int> data;
| ^~~~~
| :
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:14:13: error: overloaded function with no contextual type information
14 | data.push_back(input);
| ^~~~~~~~~
a.cc:17:15: error: overloaded function with no contextual type information
17 | sort(data.begin,data.end,grater<int>());
| ^~~~~
a.cc:17:26: error: overloaded function with no contextual type information
17 | sort(data.begin,data.end,grater<int>());
| ^~~
a.cc:17:30: error: 'grater' was not declared in this scope
17 | sort(data.begin,data.end,grater<int>());
| ^~~~~~
a.cc:17:37: error: expected primary-expression before 'int'
17 | sort(data.begin,data.end,grater<int>());
| ^~~
a.cc:19:18: error: expected ';' before '<' token
19 | for(int i=0,i<3;i++)
| ^
| ;
a.cc:19:18: error: expected primary-expression before '<' token
a.cc:21:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
21 | cout<<data[i]<<endl;
| ^
|
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++)
{
cout<<data[i]<<endl;
}
return 0;
}
|
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 | ??????vector<int> data;
| ^
a.cc:8:4: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:5: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:6: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:19: error: expected primary-expression before 'data'
8 | ??????vector<int> data;
| ^~~~
a.cc:8:18: error: expected ':' before 'data'
8 | ??????vector<int> data;
| ^~~~~
| :
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:14:13: error: overloaded function with no contextual type information
14 | data.push_back(input);
| ^~~~~~~~~
a.cc:17:15: error: overloaded function with no contextual type information
17 | sort(data.begin,data.end,greater<int>());
| ^~~~~
a.cc:17:26: error: overloaded function with no contextual type information
17 | sort(data.begin,data.end,greater<int>());
| ^~~
a.cc:19:18: error: expected ';' before '<' token
19 | for(int i=0,i<3;i++)
| ^
| ;
a.cc:19:18: error: expected primary-expression before '<' token
a.cc:21:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
21 | cout<<data[i]<<endl;
| ^
|
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++)
{
cout<<data[i]<<endl;
}
return 0;
}
|
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 | ??????vector<int> data;
| ^
a.cc:8:4: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:5: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:6: error: expected primary-expression before '?' token
8 | ??????vector<int> data;
| ^
a.cc:8:19: error: expected primary-expression before 'data'
8 | ??????vector<int> data;
| ^~~~
a.cc:8:18: error: expected ':' before 'data'
8 | ??????vector<int> data;
| ^~~~~
| :
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:8:23: error: expected ':' before ';' token
8 | ??????vector<int> data;
| ^
| :
a.cc:8:23: error: expected primary-expression before ';' token
a.cc:14:13: error: overloaded function with no contextual type information
14 | data.push_back(input);
| ^~~~~~~~~
a.cc:17:15: error: overloaded function with no contextual type information
17 | sort(data.begin(),data.end(),greater<int>());
| ^~~~~
a.cc:17:28: error: overloaded function with no contextual type information
17 | sort(data.begin(),data.end(),greater<int>());
| ^~~
a.cc:19:18: error: expected ';' before '<' token
19 | for(int i=0,i<3;i++)
| ^
| ;
a.cc:19:18: error: expected primary-expression before '<' token
a.cc:21:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
21 | cout<<data[i]<<endl;
| ^
|
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;i<3;i++)
{
cout<<data[i]<<endl;
}
return 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 | ??????vector<int> data;
| ^
a.cc:9:4: error: expected primary-expression before '?' token
9 | ??????vector<int> data;
| ^
a.cc:9:5: error: expected primary-expression before '?' token
9 | ??????vector<int> data;
| ^
a.cc:9:6: error: expected primary-expression before '?' token
9 | ??????vector<int> data;
| ^
a.cc:9:19: error: expected primary-expression before 'data'
9 | ??????vector<int> data;
| ^~~~
a.cc:9:18: error: expected ':' before 'data'
9 | ??????vector<int> data;
| ^~~~~
| :
a.cc:9:23: error: expected ':' before ';' token
9 | ??????vector<int> data;
| ^
| :
a.cc:9:23: error: expected primary-expression before ';' token
a.cc:9:23: error: expected ':' before ';' token
9 | ??????vector<int> data;
| ^
| :
a.cc:9:23: error: expected primary-expression before ';' token
a.cc:9:23: error: expected ':' before ';' token
9 | ??????vector<int> data;
| ^
| :
a.cc:9:23: error: expected primary-expression before ';' token
a.cc:9:23: error: expected ':' before ';' token
9 | ??????vector<int> data;
| ^
| :
a.cc:9:23: error: expected primary-expression before ';' token
a.cc:9:23: error: expected ':' before ';' token
9 | ??????vector<int> data;
| ^
| :
a.cc:9:23: error: expected primary-expression before ';' token
a.cc:15:13: error: overloaded function with no contextual type information
15 | data.push_back(input);
| ^~~~~~~~~
a.cc:18:15: error: overloaded function with no contextual type information
18 | sort(data.begin(),data.end(),greater<int>());
| ^~~~~
a.cc:18:28: error: overloaded function with no contextual type information
18 | sort(data.begin(),data.end(),greater<int>());
| ^~~
a.cc:22:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
22 | cout<<data[i]<<endl;
| ^
|
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=0;i<3;i++)
{
cout<<data[i]<<endl;
}
return 0;
}
|
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 | ??????vector<int> data;
| ^
a.cc:10:4: error: expected primary-expression before '?' token
10 | ??????vector<int> data;
| ^
a.cc:10:5: error: expected primary-expression before '?' token
10 | ??????vector<int> data;
| ^
a.cc:10:6: error: expected primary-expression before '?' token
10 | ??????vector<int> data;
| ^
a.cc:10:19: error: expected primary-expression before 'data'
10 | ??????vector<int> data;
| ^~~~
a.cc:10:18: error: expected ':' before 'data'
10 | ??????vector<int> data;
| ^~~~~
| :
a.cc:10:23: error: expected ':' before ';' token
10 | ??????vector<int> data;
| ^
| :
a.cc:10:23: error: expected primary-expression before ';' token
a.cc:10:23: error: expected ':' before ';' token
10 | ??????vector<int> data;
| ^
| :
a.cc:10:23: error: expected primary-expression before ';' token
a.cc:10:23: error: expected ':' before ';' token
10 | ??????vector<int> data;
| ^
| :
a.cc:10:23: error: expected primary-expression before ';' token
a.cc:10:23: error: expected ':' before ';' token
10 | ??????vector<int> data;
| ^
| :
a.cc:10:23: error: expected primary-expression before ';' token
a.cc:10:23: error: expected ':' before ';' token
10 | ??????vector<int> data;
| ^
| :
a.cc:10:23: error: expected primary-expression before ';' token
a.cc:16:13: error: overloaded function with no contextual type information
16 | data.push_back(input);
| ^~~~~~~~~
a.cc:19:15: error: overloaded function with no contextual type information
19 | sort(data.begin(),data.end(),greater<int>());
| ^~~~~
a.cc:19:28: error: overloaded function with no contextual type information
19 | sort(data.begin(),data.end(),greater<int>());
| ^~~
a.cc:23:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
23 | cout<<data[i]<<endl;
| ^
|
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];
| ^
a.cc:8:4: error: expected primary-expression before '?' token
8 | ??????int data[10];
| ^
a.cc:8:5: error: expected primary-expression before '?' token
8 | ??????int data[10];
| ^
a.cc:8:6: error: expected primary-expression before '?' token
8 | ??????int data[10];
| ^
a.cc:8:7: error: expected primary-expression before 'int'
8 | ??????int data[10];
| ^~~
a.cc:8:7: error: expected ':' before 'int'
8 | ??????int data[10];
| ^~~
| :
a.cc:8:7: error: expected primary-expression before 'int'
8 | ??????int data[10];
| ^~~
a.cc:8:7: error: expected ':' before 'int'
8 | ??????int data[10];
| ^~~
| :
a.cc:8:7: error: expected primary-expression before 'int'
8 | ??????int data[10];
| ^~~
a.cc:8:7: error: expected ':' before 'int'
8 | ??????int data[10];
| ^~~
| :
a.cc:8:7: error: expected primary-expression before 'int'
8 | ??????int data[10];
| ^~~
a.cc:8:7: error: expected ':' before 'int'
8 | ??????int data[10];
| ^~~
| :
a.cc:8:7: error: expected primary-expression before 'int'
8 | ??????int data[10];
| ^~~
a.cc:8:7: error: expected ':' before 'int'
8 | ??????int data[10];
| ^~~
| :
a.cc:8:7: error: expected primary-expression before 'int'
8 | ??????int data[10];
| ^~~
a.cc:8:7: error: expected ':' before 'int'
8 | ??????int data[10];
| ^~~
| :
a.cc:8:7: error: expected primary-expression before 'int'
8 | ??????int data[10];
| ^~~
a.cc:12:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
12 | cin>>data[i];
| ^
a.cc:15:19: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
15 | sort(data,data+10,greater<int>());
| ~~~~^~~
a.cc:19:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
19 | cout<<data[i]<<endl;
| ^
|
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];
| ^
a.cc:7:4: error: expected primary-expression before '?' token
7 | ??????int data[10];
| ^
a.cc:7:5: error: expected primary-expression before '?' token
7 | ??????int data[10];
| ^
a.cc:7:6: error: expected primary-expression before '?' token
7 | ??????int data[10];
| ^
a.cc:7:7: error: expected primary-expression before 'int'
7 | ??????int data[10];
| ^~~
a.cc:7:7: error: expected ':' before 'int'
7 | ??????int data[10];
| ^~~
| :
a.cc:7:7: error: expected primary-expression before 'int'
7 | ??????int data[10];
| ^~~
a.cc:7:7: error: expected ':' before 'int'
7 | ??????int data[10];
| ^~~
| :
a.cc:7:7: error: expected primary-expression before 'int'
7 | ??????int data[10];
| ^~~
a.cc:7:7: error: expected ':' before 'int'
7 | ??????int data[10];
| ^~~
| :
a.cc:7:7: error: expected primary-expression before 'int'
7 | ??????int data[10];
| ^~~
a.cc:7:7: error: expected ':' before 'int'
7 | ??????int data[10];
| ^~~
| :
a.cc:7:7: error: expected primary-expression before 'int'
7 | ??????int data[10];
| ^~~
a.cc:7:7: error: expected ':' before 'int'
7 | ??????int data[10];
| ^~~
| :
a.cc:7:7: error: expected primary-expression before 'int'
7 | ??????int data[10];
| ^~~
a.cc:7:7: error: expected ':' before 'int'
7 | ??????int data[10];
| ^~~
| :
a.cc:7:7: error: expected primary-expression before 'int'
7 | ??????int data[10];
| ^~~
a.cc:11:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
11 | cin>>data[i];
| ^
a.cc:17:18: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
17 | cout<<data[i]<<endl;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.