submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s363585221
|
p00001
|
C++
|
#include<iostream>
#include <algorithm>
using namespace std;
int main(){
int h[10];
for(int i = 0; i < 10; i++){
cin >> h[i];
}
sort(h,h+10,desc);
for(int i = 0; i < 3; i++){
cout << h[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:21: error: 'desc' was not declared in this scope
11 | sort(h,h+10,desc);
| ^~~~
|
s019162117
|
p00001
|
C++
|
#include <stdio.h>
main(){
int h[10];
int st,nd,rd;
st = 0;
nd = 0;
rd = 0;
for(i=0;i<10;i++){
scanf("%d",&h[i]);
if(h[i]>st){
st = h[i];
}else if(h[i]>nd){
nd = h[i];
}else if(h[i]>rd){
rd = h[i];
}
}
printf("%d\n%d\n%d\n",st,nd,rd);
}
|
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
8 | for(i=0;i<10;i++){
| ^
|
s130154831
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int x[10];
int main(){
for(i=0;i<10;i++){
cin>>x[i];
}
sort(x,x+10);
cout>>x[7]>>endl;
cout>>x[8]>>endl;
cout>>x[9]>>endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:5: error: 'i' was not declared in this scope
7 | for(i=0;i<10;i++){
| ^
a.cc:11:5: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
11 | cout>>x[7]>>endl;
| ~~~~^~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:11:5: note: candidate: 'operator>>(int, int)' (built-in)
11 | cout>>x[7]>>endl;
| ~~~~^~~~~~
a.cc:11:5: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:11:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
11 | cout>>x[7]>>endl;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:11:1: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
11 | cout>>x[7]>>endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:11:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
11 | cout>>x[7]>>endl;
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:11:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | cout>>x[7]>>endl;
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:11:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | cout>>x[7]>>endl;
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:11:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
11 | cout>>x[7]>>endl;
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:11:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | cout>>x[7]>>endl;
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:11:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | cout>>x[7]>>endl;
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
a.cc:11:10: required from here
11 | cout>>x[7]>>endl;
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
a.cc:12:5: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
12 | cout>>x[8]>>endl;
| ~~~~^~~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:12:5: note: candidate: 'operator>>(int, int)' (built-in)
12 | cout>>x[8]>>endl;
| ~~~~^~~~~~
a.cc:12:5: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:12:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout>>x[8]>>endl;
| ^
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:12:1: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
12 | cout>>x[8]>>endl;
| ^~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:12:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout>>x[8]>>endl;
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:12:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
12 | cout>>x[8]>>endl;
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:12:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
12 | cout>>x[8]>>endl;
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:12:10: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
12 | cout>>x[8]>>endl;
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char
|
s264182785
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int x[10];
int main(){
for(i=0;i<10;i++){
cin>>x[i];
}
sort(x,x+10);
cout<<x[7]<<endl;
cout<<x[8]<<endl;
cout<<x[9]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:5: error: 'i' was not declared in this scope
7 | for(i=0;i<10;i++){
| ^
|
s894352729
|
p00001
|
C++
|
#include <stdio.h>
int main(void){
int d, m1 ,m2 ,m3, i;
for(i=0;i<10;i++){
scanf("%d",&d);
if(d>m1){
m3=m2 ;
m2=m1 ;
m1=d ;
}else if (d>m2){
m3=m2 ;
m2=d ;
}else if (m3<d){
m3=d ;
}
printf("%d\n%d\n%d\n", m1. m2 ,m3 ) ;
return 0
|
a.cc: In function 'int main()':
a.cc:16:36: error: request for member 'm2' in 'm1', which is of non-class type 'int'
16 | printf("%d\n%d\n%d\n", m1. m2 ,m3 ) ;
| ^~
a.cc:17:17: error: expected ';' at end of input
17 | return 0
| ^
| ;
a.cc:17:17: error: expected '}' at end of input
a.cc:4:26: note: to match this '{'
4 | for(i=0;i<10;i++){
| ^
a.cc:17:17: error: expected '}' at end of input
17 | return 0
| ^
a.cc:2:15: note: to match this '{'
2 | int main(void){
| ^
|
s303857734
|
p00001
|
C++
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include<stdio.h>
int main(){
int i,j,t,data[10];
for(i=0;i<10;i++)
{
scanf("%d",&data[i]);
}
for(i=0;i<9;i++)
{
for(j=0;j<9-i;j++)
{
if(data[j]<data[j+1])
{
t=data[j];
data[j]=data[j+1];
data[j+1]=t;
}
}
}
for(i=0;i<3;i++)
{
printf("%d\n",data[i]);
}
return 0;
|
a.cc:3:1: error: expected unqualified-id before numeric constant
3 | 1
| ^
a.cc: In function 'int main()':
a.cc:39:9: error: 'scanf' was not declared in this scope
39 | scanf("%d",&data[i]);
| ^~~~~
a.cc:56:9: error: 'printf' was not declared in this scope
56 | printf("%d\n",data[i]);
| ^~~~~~
a.cc:33:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
32 | #include<stdio.h>
+++ |+#include <cstdio>
33 |
a.cc:59:14: error: expected '}' at end of input
59 | return 0;
| ^
a.cc:34:11: note: to match this '{'
34 | int main(){
| ^
|
s198579514
|
p00001
|
C++
|
Z:\H28\paso2016\toi02
|
a.cc:1:3: error: stray '\' in program
1 | Z:\H28\paso2016\toi02
| ^
a.cc:1:7: error: stray '\' in program
1 | Z:\H28\paso2016\toi02
| ^
a.cc:1:16: error: stray '\' in program
1 | Z:\H28\paso2016\toi02
| ^
a.cc:1:2: error: found ':' in nested-name-specifier, expected '::'
1 | Z:\H28\paso2016\toi02
| ^
| ::
a.cc:1:1: error: 'Z' does not name a type
1 | Z:\H28\paso2016\toi02
| ^
|
s062228180
|
p00001
|
C++
|
h = []
10.times {h << gets.to_i}
h.sort.reverse.take(3).each{|hh| puts hh}
|
a.cc:1:1: error: 'h' does not name a type
1 | h = []
| ^
a.cc:3:1: error: 'h' does not name a type
3 | h.sort.reverse.take(3).each{|hh| puts hh}
| ^
|
s804218729
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
vecctor<int> v;
int num;
for(int i = 0;i<10;i++){
cin>>num;
v.push_back(num);
}
sort(v.end(),v.begin(),greater<int>());
for(int i = 0;i<3;i++)
cout<<v.at(i);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:5: error: 'vecctor' was not declared in this scope
7 | vecctor<int> v;
| ^~~~~~~
a.cc:7:13: error: expected primary-expression before 'int'
7 | vecctor<int> v;
| ^~~
a.cc:11:9: error: 'v' was not declared in this scope
11 | v.push_back(num);
| ^
a.cc:14:10: error: 'v' was not declared in this scope
14 | sort(v.end(),v.begin(),greater<int>());
| ^
|
s955068944
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
vecctor<int> v;
int num;
for(int i = 0;i<10;i++){
cin>>num;
v.push_back(num);
}
sort(v.end(),v.begin(),greater<int>());
for(int i = 0;i<3;i++)
cout<<v.at(i);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:5: error: 'vecctor' was not declared in this scope
7 | vecctor<int> v;
| ^~~~~~~
a.cc:7:13: error: expected primary-expression before 'int'
7 | vecctor<int> v;
| ^~~
a.cc:11:9: error: 'v' was not declared in this scope
11 | v.push_back(num);
| ^
a.cc:14:10: error: 'v' was not declared in this scope
14 | sort(v.end(),v.begin(),greater<int>());
| ^
|
s953560890
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> heights;
int input;
int main(){
while(cin >> input) heights.push_back(input);
sort(input.begin(), input.end());
auto itr = input.end();
cout << *itr << "\n" << *(itr-1) << "\n" << *(itr-2) << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:13: error: request for member 'begin' in 'input', which is of non-class type 'int'
12 | sort(input.begin(), input.end());
| ^~~~~
a.cc:12:28: error: request for member 'end' in 'input', which is of non-class type 'int'
12 | sort(input.begin(), input.end());
| ^~~
a.cc:13:19: error: request for member 'end' in 'input', which is of non-class type 'int'
13 | auto itr = input.end();
| ^~~
|
s722752252
|
p00001
|
C++
|
//
// Created by tac on 2016/10/27.
//
#include <cstdlib>
#include <functional>
#include <vector>
#include <iostream>
const int N_SIZE = 10000;
int main() {
std::vector<int> v(N_SIZE);
int n = 10;
int s;
for (int i = 0; i < n; ++i) {
std::cin >> s;
v.push_back(s);
}
std::sort(v.begin(), v.end(), std::greater<int>());
for (int j = 0; j < 3; ++j) {
std::cout << v[j] << std::endl;
}
return EXIT_SUCCESS;
}
|
a.cc: In function 'int main()':
a.cc:20:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
20 | std::sort(v.begin(), v.end(), std::greater<int>());
| ^~~~
| qsort
|
s370493996
|
p00001
|
C++
|
#include<stdio>
int main(){
printf("aaaaaaaa");
return 0;
}
|
a.cc:1:9: fatal error: stdio: No such file or directory
1 | #include<stdio>
| ^~~~~~~
compilation terminated.
|
s557154459
|
p00001
|
C++
|
file:///home/ooki/AOJ/top3.c
|
a.cc:1:1: error: 'file' does not name a type
1 | file:///home/ooki/AOJ/top3.c
| ^~~~
|
s948142826
|
p00001
|
C++
|
file:///home/ooki/AOJ/top3.c
|
a.cc:1:1: error: 'file' does not name a type
1 | file:///home/ooki/AOJ/top3.c
| ^~~~
|
s955767916
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
int a[10];
for(int i=0;i<10;i++){
scans(" %d",&a[i]);
}
sort(a,a+10);
for(int i=9;i>=7;i--){
cout << a[i] <<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:1: error: 'scans' was not declared in this scope; did you mean 'scanf'?
10 | scans(" %d",&a[i]);
| ^~~~~
| scanf
|
s616540371
|
p00001
|
C++
|
A = sorted([int(raw_input()) for _ in xrange(10)])
print A[9]
print A[8]
Print a[7]
|
a.cc:1:1: error: 'A' does not name a type
1 | A = sorted([int(raw_input()) for _ in xrange(10)])
| ^
|
s637751924
|
p00001
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 999999999
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FFOR(i,a,b) for (int i=(a);i>(b);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define SORT(c) sort((c).begin(),(c).end())
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> Vi;
int a[10];
int main(){
REP(i,10){
cin>>a[i];
}
SORT(a);
FFOR(i,9,6){
cout<<a[i]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:26: error: request for member 'begin' in 'a', which is of non-class type 'int [10]'
9 | #define SORT(c) sort((c).begin(),(c).end())
| ^~~~~
a.cc:19:3: note: in expansion of macro 'SORT'
19 | SORT(a);
| ^~~~
a.cc:9:38: error: request for member 'end' in 'a', which is of non-class type 'int [10]'
9 | #define SORT(c) sort((c).begin(),(c).end())
| ^~~
a.cc:19:3: note: in expansion of macro 'SORT'
19 | SORT(a);
| ^~~~
|
s817355578
|
p00001
|
C++
|
#include<iostream>
int main() {
typedef unsigned short int mew;
mew mountain[10];
for (int i = 0; i < 10; i++) {
cin >> mountain[i];
}
mew taller[3];
mew a, b, c;
a = mountain[0];
b = mountain[1];
c = mountain[2];
for (int y = 3; y <= 9; y++) {
if (a<=b){
if (a<=c){
if (a < mountain[y]) {
???a = mountain[y];}
}
else{
if (c < mountain[y]) {
c = mountain[y];}
}
}
else if (b<=c)
{
if (b < mountain[y]) {
b = mountain[y];}
}
}
//biggest->taller[0],bigger->taller[1],taller[2]
{
if (a >= b&&a >= c)
{
taller[0] = a;
if (b >= c)
{
taller[1] = b;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = b;
}
}
if (b >= a&&b >= c)
{
taller[0] = b;
if (a >= c)
{
taller[1] = a;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = a;
}
}
if (c >= b&&c >= a)
{
taller[0] = c;
if (b >= a)
{
taller[1] = b;
taller[2] = a;
}
else {
taller[1] = a;
taller[2] = b;
}
}
}
cout << taller[0] << endl;
cout << taller[1] << endl;
cout << taller[2] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> mountain[i];
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:20:33: error: expected primary-expression before '?' token
20 | ???a = mountain[y];}
| ^
a.cc:20:34: error: expected primary-expression before '?' token
20 | ???a = mountain[y];}
| ^
a.cc:20:35: error: expected primary-expression before '?' token
20 | ???a = mountain[y];}
| ^
a.cc:20:51: error: expected ':' before ';' token
20 | ???a = mountain[y];}
| ^
| :
a.cc:20:51: error: expected primary-expression before ';' token
a.cc:20:51: error: expected ':' before ';' token
20 | ???a = mountain[y];}
| ^
| :
a.cc:20:51: error: expected primary-expression before ';' token
a.cc:20:51: error: expected ':' before ';' token
20 | ???a = mountain[y];}
| ^
| :
a.cc:20:51: error: expected primary-expression before ';' token
a.cc:77:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
77 | cout << taller[0] << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:77:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
77 | cout << taller[0] << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s663091930
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main() {
typedef unsigned short int mew;
mew mountain[10];
for (int i = 0; i < 10; i++) {
cin >> mountain[i];
}
mew taller[3];
mew a, b, c;
a = mountain[0];
b = mountain[1];
c = mountain[2];
for (int y = 3; y <= 9; y++) {
if (a<=b){
if (a<=c){
if (a < mountain[y]) {
???a = mountain[y];}
}
else{
if (c < mountain[y]) {
c = mountain[y];}
}
}
else if (b<=c)
{
if (b < mountain[y]) {
b = mountain[y];}
}
}
//biggest->taller[0],bigger->taller[1],taller[2]
{
if (a >= b&&a >= c)
{
taller[0] = a;
if (b >= c)
{
taller[1] = b;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = b;
}
}
if (b >= a&&b >= c)
{
taller[0] = b;
if (a >= c)
{
taller[1] = a;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = a;
}
}
if (c >= b&&c >= a)
{
taller[0] = c;
if (b >= a)
{
taller[1] = b;
taller[2] = a;
}
else {
taller[1] = a;
taller[2] = b;
}
}
}
cout << taller[0] << endl;
cout << taller[1] << endl;
cout << taller[2] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:33: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:34: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:35: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
|
s459067547
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main() {
typedef unsigned short int mew;
mew mountain[10];
for (int i = 0; i < 10; i++) {
cin >> mountain[i];
}
mew taller[3];
mew a, b, c;
a = mountain[0];
b = mountain[1];
c = mountain[2];
for (int y = 3; y <= 9; y++) {
if (a<=b){
if (a<=c){
if (a < mountain[y]) {
???a = mountain[y];}
}
else{
if (c < mountain[y]) {
c = mountain[y];}
}
}
else if (b<=c)
{
if (b < mountain[y]) {
b = mountain[y];}
}
}
//biggest->taller[0],bigger->taller[1],taller[2]
{
if (a >= b&&a >= c)
{
taller[0] = a;
if (b >= c)
{
taller[1] = b;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = b;
}
}
if (b >= a&&b >= c)
{
taller[0] = b;
if (a >= c)
{
taller[1] = a;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = a;
}
}
if (c >= b&&c >= a)
{
taller[0] = c;
if (b >= a)
{
taller[1] = b;
taller[2] = a;
}
else {
taller[1] = a;
taller[2] = b;
}
}
}
cout << taller[0] << endl;
cout << taller[1] << endl;
cout << taller[2] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:33: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:34: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:35: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
|
s646256021
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main() {
typedef unsigned short int mew;
mew mountain[10];
for (int i = 0; i < 10; i++) {
cin >> mountain[i];
}
mew taller[3];
mew a, b, c;
a = mountain[0];
b = mountain[1];
c = mountain[2];
for (int y = 3; y <= 9; y++) {
if (a<=b){
if (a<=c){
if (a < mountain[y]) {
???a = mountain[y];}
}
else{
if (c < mountain[y]) {
c = mountain[y];}
}
}
else if (b<=c)
{
if (b < mountain[y]) {
b = mountain[y];}
}
}
//biggest->taller[0],bigger->taller[1],taller[2]
{
if (a >= b&&a >= c)
{
taller[0] = a;
if (b >= c)
{
taller[1] = b;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = b;
}
}
if (b >= a&&b >= c)
{
taller[0] = b;
if (a >= c)
{
taller[1] = a;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = a;
}
}
if (c >= b&&c >= a)
{
taller[0] = c;
if (b >= a)
{
taller[1] = b;
taller[2] = a;
}
else {
taller[1] = a;
taller[2] = b;
}
}
}
cout << taller[0] << endl;
cout << taller[1] << endl;
cout << taller[2] << endl;
char c_
cin>>c_
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:33: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:34: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:35: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
a.cc:83:9: error: expected initializer before 'cin'
83 | cin>>c_
| ^~~
|
s938252642
|
p00001
|
C++
|
using System;
using System.Linq;
namespace _0001
{
class Program
{
static void Main(string[] args)
{
int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
int[] mountain = new int[] { a[0],a[1],a[2] };
Array.Sort(mountain);
Console.WriteLine(mountain[0]+" "+mountain[1]+" "+mountain[2]);
}
}
}
|
a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Linq;
| ^~~~~~
a.cc:7:26: error: 'string' has not been declared
7 | static void Main(string[] args)
| ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
7 | static void Main(string[] args)
| ^~~~
a.cc:14:6: error: expected ';' after class definition
14 | }
| ^
| ;
a.cc: In static member function 'static void _0001::Program::Main(int*)':
a.cc:9:16: error: structured binding declaration cannot have type 'int'
9 | int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
| ^~
a.cc:9:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:9:16: error: empty structured binding declaration
a.cc:9:19: error: expected initializer before 'a'
9 | int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
| ^
a.cc:10:20: error: structured binding declaration cannot have type 'int'
10 | int[] mountain = new int[] { a[0],a[1],a[2] };
| ^~
a.cc:10:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:10:20: error: empty structured binding declaration
a.cc:10:23: error: expected initializer before 'mountain'
10 | int[] mountain = new int[] { a[0],a[1],a[2] };
| ^~~~~~~~
a.cc:11:13: error: 'Array' was not declared in this scope
11 | Array.Sort(mountain);
| ^~~~~
a.cc:11:24: error: 'mountain' was not declared in this scope
11 | Array.Sort(mountain);
| ^~~~~~~~
a.cc:12:13: error: 'Console' was not declared in this scope
12 | Console.WriteLine(mountain[0]+" "+mountain[1]+" "+mountain[2]);
| ^~~~~~~
|
s855905171
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main() {
typedef unsigned short int mew;
mew mountain[10];
for (int i = 0; i < 10; i++) {
cin >> mountain[i];
}
mew taller[3];
mew a, b, c;
a = mountain[0];
b = mountain[1];
c = mountain[2];
for (int y = 3; y <= 9; y++) {
if (a<=b){
if (a<=c){
if (a < mountain[y]) {
???a = mountain[y];}
}
else{
if (c < mountain[y]) {
c = mountain[y];}
}
}
else if (b<=c)
{
if (b < mountain[y]) {
b = mountain[y];}
}
}
//biggest->taller[0],bigger->taller[1],taller[2]
{
if (a >= b&&a >= c)
{
taller[0] = a;
if (b >= c)
{
taller[1] = b;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = b;
}
}
if (b >= a&&b >= c)
{
taller[0] = b;
if (a >= c)
{
taller[1] = a;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = a;
}
}
if (c >= b&&c >= a)
{
taller[0] = c;
if (b >= a)
{
taller[1] = b;
taller[2] = a;
}
else {
taller[1] = a;
taller[2] = b;
}
}
}
cout << taller[0] << endl;
cout << taller[1] << endl;
cout << taller[2] << endl;
char a____;
cin>>a____;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:33: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:34: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:35: error: expected primary-expression before '?' token
21 | ???a = mountain[y];}
| ^
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
a.cc:21:51: error: expected ':' before ';' token
21 | ???a = mountain[y];}
| ^
| :
a.cc:21:51: error: expected primary-expression before ';' token
|
s936389934
|
p00001
|
C++
|
int main() {
typedef unsigned short int mew;
mew mountain[10];
for (int i = 0; i < 10; i++) {
cin >> mountain[i];
}
mew taller[3];
mew a, b, c;
a = mountain[0];
b = mountain[1];
c = mountain[2];
for (int y = 3; y <= 9; y++) {
if (a<=b){
if (a<=c){
if (a < mountain[y]) {
???a = mountain[y];}
}
else{
if (c < mountain[y]) {
c = mountain[y];}
}
}
else if (b<=c)
{
if (b < mountain[y]) {
b = mountain[y];}
}
}
//biggest->taller[0],bigger->taller[1],taller[2]
{
if (a >= b&&a >= c)
{
taller[0] = a;
if (b >= c)
{
taller[1] = b;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = b;
}
}
if (b >= a&&b >= c)
{
taller[0] = b;
if (a >= c)
{
taller[1] = a;
taller[2] = c;
}
else {
taller[1] = c;
taller[2] = a;
}
}
if (c >= b&&c >= a)
{
taller[0] = c;
if (b >= a)
{
taller[1] = b;
taller[2] = a;
}
else {
taller[1] = a;
taller[2] = b;
}
}
}
cout << taller[0] << endl;
cout << taller[1] << endl;
cout << taller[2] << endl;
char a____;
cin >> a____;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:17: error: 'cin' was not declared in this scope
5 | cin >> mountain[i];
| ^~~
a.cc:19:33: error: expected primary-expression before '?' token
19 | ???a = mountain[y];}
| ^
a.cc:19:34: error: expected primary-expression before '?' token
19 | ???a = mountain[y];}
| ^
a.cc:19:35: error: expected primary-expression before '?' token
19 | ???a = mountain[y];}
| ^
a.cc:19:51: error: expected ':' before ';' token
19 | ???a = mountain[y];}
| ^
| :
a.cc:19:51: error: expected primary-expression before ';' token
a.cc:19:51: error: expected ':' before ';' token
19 | ???a = mountain[y];}
| ^
| :
a.cc:19:51: error: expected primary-expression before ';' token
a.cc:19:51: error: expected ':' before ';' token
19 | ???a = mountain[y];}
| ^
| :
a.cc:19:51: error: expected primary-expression before ';' token
a.cc:76:9: error: 'cout' was not declared in this scope
76 | cout << taller[0] << endl;
| ^~~~
a.cc:76:30: error: 'endl' was not declared in this scope
76 | cout << taller[0] << endl;
| ^~~~
a.cc:81:9: error: 'cin' was not declared in this scope
81 | cin >> a____;
| ^~~
|
s489885932
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main() {
int a[10];
for (int i = 0; i < 10; i++ ) {
cin >> a[i];
}
sort(a, a+ 9);
printf("%d\n", a[9]);
printf("%d\n", a[8]);
printf("%d\n", a[7]);
}
|
a.cc: In function 'int main()':
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(a, a+ 9);
| ^~~~
| short
|
s033648724
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int n[10];
for(int i=0;i<10;i++)
cin>>n[i];
sort(n,n+10);
for(int i=9;i>=7;i--){
cout<<n[i]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:3: error: 'sort' was not declared in this scope; did you mean 'short'?
7 | sort(n,n+10);
| ^~~~
| short
|
s879559443
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
const int N=10;
int date[N];
int tmp;
for(int i=0;i<N;i++) cin>>data[i];
for(int i=1;i<=3;i++){
for(int j=0;j<N-i;j++){
if(data[j]>data[j+1]){
tmp=data[j];
data[j]=data[j+1];
data[j+1]=tmp;
}
}
}
cout<<data[N-1]<<endl<<data[N-2]<<endl<<data[N-3]<<endl;
}
|
a.cc: In function 'int main()':
a.cc:9:39: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
9 | for(int i=0;i<N;i++) cin>>data[i];
| ^
a.cc:12:32: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
12 | if(data[j]>data[j+1]){
| ^
a.cc:12:40: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
12 | if(data[j]>data[j+1]){
| ^
a.cc:13:41: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
13 | tmp=data[j];
| ^
a.cc:14:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
14 | data[j]=data[j+1];
| ^
a.cc:14:45: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
14 | data[j]=data[j+1];
| ^
a.cc:15:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
15 | data[j+1]=tmp;
| ^
a.cc:19:19: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
19 | cout<<data[N-1]<<endl<<data[N-2]<<endl<<data[N-3]<<endl;
| ^
a.cc:19:36: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
19 | cout<<data[N-1]<<endl<<data[N-2]<<endl<<data[N-3]<<endl;
| ^
a.cc:19:53: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
19 | cout<<data[N-1]<<endl<<data[N-2]<<endl<<data[N-3]<<endl;
| ^
|
s505035667
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
const int N=10;
int date[N];
int tmp;
for(int i=0;i<N;i++) cin>>data[i];
for(int i=1;i<=3;i++){
for(int j=0;j<N-i;j++){
if(data[j]>data[j+1]){
tmp=data[j];
data[j]=data[j+1];
data[j+1]=tmp;
}
}
}
cout<<data[N-1]<<endl<<data[N-2]<<endl<<data[N-3]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:39: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
9 | for(int i=0;i<N;i++) cin>>data[i];
| ^
a.cc:12:32: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
12 | if(data[j]>data[j+1]){
| ^
a.cc:12:40: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
12 | if(data[j]>data[j+1]){
| ^
a.cc:13:41: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
13 | tmp=data[j];
| ^
a.cc:14:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
14 | data[j]=data[j+1];
| ^
a.cc:14:45: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
14 | data[j]=data[j+1];
| ^
a.cc:15:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
15 | data[j+1]=tmp;
| ^
a.cc:19:19: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
19 | cout<<data[N-1]<<endl<<data[N-2]<<endl<<data[N-3]<<endl;
| ^
a.cc:19:36: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
19 | cout<<data[N-1]<<endl<<data[N-2]<<endl<<data[N-3]<<endl;
| ^
a.cc:19:53: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
19 | cout<<data[N-1]<<endl<<data[N-2]<<endl<<data[N-3]<<endl;
| ^
|
s905817586
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
int main(){
int array[10];
for(int i=0; i<10; i++){
std::cin >> array[i];
}
std::sort(array.begin(), array.end());
for(int i=0; i<3; i++){
std::cout << array[i] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:19: error: request for member 'begin' in 'array', which is of non-class type 'int [10]'
11 | std::sort(array.begin(), array.end());
| ^~~~~
a.cc:11:34: error: request for member 'end' in 'array', which is of non-class type 'int [10]'
11 | std::sort(array.begin(), array.end());
| ^~~
|
s416568885
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
int main(){
int array[10];
for(int i=0; i<10; i++){
std::cin >> array[i];
}
std::vector<int> vector(array, array+10)
std::sort(vector.begin(), vector.end());
for(int i=0; i<3; i++){
std::cout << vector[i] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:3: error: expected ',' or ';' before 'std'
13 | std::sort(vector.begin(), vector.end());
| ^~~
|
s267406710
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
int main(){
int array[10];
for(int i=0; i<10; i++){
std::cin >> array[i];
}
std::vector<int> vector(array, array+10);
std::sort(vector.begin(), vector.end(), >);
for(int i=0; i<3; i++){
std::cout << vector[i] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:43: error: expected primary-expression before '>' token
13 | std::sort(vector.begin(), vector.end(), >);
| ^
a.cc:13:44: error: expected primary-expression before ')' token
13 | std::sort(vector.begin(), vector.end(), >);
| ^
|
s985412917
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
int main(){
int array[10];
for(int i=0; i<10; i++){
std::cin >> array[i];
}
std::vector<int> vector(array, array+10);
std::sort(vector.begin(), vector.end(), std::greater<int>);
for(int i=0; i<3; i++){
std::cout << vector[i] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:60: error: expected primary-expression before ')' token
13 | std::sort(vector.begin(), vector.end(), std::greater<int>);
| ^
|
s332100193
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
vector<int> v(10);
int index = 0;
for(int i = 0; i< 10; i++){
cin >> v[i];
}
cout << *max_element(v.begin(),v.end()) << endl;
index = distance(v.begin(),max_element(v.begin(),v.end()));
v[index] = 0;
cout << *max_element(v.begin(),v.end()) << endl;
index = distance(v.begin(),max_element(v.begin(),v.end()));
v[index] = 0;
cout << *max_element(v.begin(),v.end()) << endl;
index = distance(v.begin(),max_element(v.begin(),v.end()));
v[index] = 0;
}
|
a.cc: In function 'int main()':
a.cc:6:5: error: 'vector' was not declared in this scope
6 | vector<int> v(10);
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <algorithm>
+++ |+#include <vector>
3 | using namespace std;
a.cc:6:12: error: expected primary-expression before 'int'
6 | vector<int> v(10);
| ^~~
a.cc:9:16: error: 'v' was not declared in this scope
9 | cin >> v[i];
| ^
a.cc:11:26: error: 'v' was not declared in this scope
11 | cout << *max_element(v.begin(),v.end()) << endl;
| ^
|
s133175496
|
p00001
|
C++
|
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
vector<int> v(10);
int index = 0;
for(int i = 0; i< 10; i++){
cin >> v[i];
}
cout << *max_element(v.begin(),v.end()) << endl;
index = distance(v.begin(),max_element(v.begin(),v.end()));
v[index] = 0;
cout << *max_element(v.begin(),v.end()) << endl;
index = distance(v.begin(),max_element(v.begin(),v.end()));
v[index] = 0;
cout << *max_element(v.begin(),v.end()) << endl;
index = distance(v.begin(),max_element(v.begin(),v.end()));
v[index] = 0;
}
|
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
7 | vector<int> v(10);
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <algorithm>
+++ |+#include <vector>
4 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
7 | vector<int> v(10);
| ^~~
a.cc:10:16: error: 'v' was not declared in this scope
10 | cin >> v[i];
| ^
a.cc:12:26: error: 'v' was not declared in this scope
12 | cout << *max_element(v.begin(),v.end()) << endl;
| ^
|
s371781770
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main(){
vector<int> v(10);
for(int i = 0; i< 10; i++){
cin >> v[i];
}
sort(v.begin(),v.end());
cout << v[0] << endl;
cout << v[1] << endl;
cout << v[2] << endl;
}
|
a.cc: In function 'int main()':
a.cc:11:4: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
11 | sort(v.begin(),v.end());
| ^~~~
| sqrt
|
s144973420
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main(){
vector<int> v(9);
for(int i = 0; i< 10; i++){
cin >> v[i];
}
sort(v.begin(),v.end());
cout << v[0] << endl;
cout << v[1] << endl;
cout << v[2] << endl;
}
|
a.cc: In function 'int main()':
a.cc:11:4: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
11 | sort(v.begin(),v.end());
| ^~~~
| sqrt
|
s056639229
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int a[10];
int main(){
for(int i=0;i<10;i++){
cin>>a[i];
}
soft(a[0],a[9]);
cout<<a[0]<<a[1]<<a[2]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:1: error: 'soft' was not declared in this scope
9 | soft(a[0],a[9]);
| ^~~~
|
s243659976
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int a[10];
int main(){
for(int i=0;i<9;i++){
cin>>a[i];
}
soft(a[0],a[9]);
cout<<a[0]<<a[1]<<a[2]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:1: error: 'soft' was not declared in this scope
9 | soft(a[0],a[9]);
| ^~~~
|
s309626022
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int a[10];
int main(){
for(int i=0;i<9;i++){
cin>>a[i];
}
sort(a[0],a[9]);
cout<<a[0]<<a[1]<<a[2]<<endl;
return 0;
}
|
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_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:9:5: required from here
9 | sort(a[0],a[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:9:5: required from here
9 | sort(a[0],a[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:9:5: required from here
9 | sort(a[0],a[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:9:5: required from here
9 | sort(a[0],a[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);
|
|
s440025310
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int a[10];
int main(){
for (int i = 0; i < 10;i++){
cin >> a[i];
}
sort(a[0], a[9]);
cout << a[0] << a[1] << a[2] << endl;
return 0;
}
|
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_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:9:6: required from here
9 | sort(a[0], a[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:9:6: required from here
9 | sort(a[0], a[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:9:6: required from here
9 | sort(a[0], a[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:9:6: required from here
9 | sort(a[0], a[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 | _ValueTyp
|
s920848173
|
p00001
|
C++
|
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <list>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <bitset>
#include <functional>
using namespace std;
#define FOR(i,n) for(int(i)=0;(i)<(int)(n);(i)++)
#define FORN(i,a,b,c) for(int(i)=a;i<(int)(b);i+=(c))
#define RES(x,nilai) memset(x,nilai,sizeof(x));
#define pb push_back
#define mp make_pair
#define INF 1000000000
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
inline string IS(int a){
char x[100];
sprintf(x,"%d",a); string s = x;
return s;
}
inline int SI(string a){
char x[100]; int res;
strcpy(x,a.c_str()); sscanf(x,"%d",&res);
return res;
}
//==============================================
bool cmp(int x,int y) {return x>y;}
int arr[100];
int main() {
//freopen("in.txt","r",stdin);
//freopen("13.txt","w",stdout);
ios_base::sync_with_stdio(false); cin.tie(NULL);
for(int i =0 ;i < 10; i++) cin >> arr[i];
sort(arr,arr+10)
cout << arr[9] << endl << arr[8] << endl << arr[7] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:58:25: error: expected ';' before 'cout'
58 | sort(arr,arr+10)
| ^
| ;
59 | cout << arr[9] << endl << arr[8] << endl << arr[7] << endl;
| ~~~~
|
s099741970
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int n[17];
int main(){
for(int i=0; i<10; i++){
cin>>n[i];
}
sort(n,n+10);
for(int i=9; i>6; i--x){
cout<<n[i]<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:10:30: error: expected ')' before 'x'
10 | for(int i=9; i>6; i--x){
| ~ ^
| )
a.cc:10:30: error: 'x' was not declared in this scope
|
s542582862
|
p00001
|
C++
|
#include <iostream>
void Sort(int* a){
int tmp;
for(int i=0;i<10;i++){
for(int j=0;j<9;j++){
if(a[j]<a[j+1]){
tmp = a[j+1];
a[j+1]=a[j];
a[j] = tmp;
}
}
}
}
int main(){
int a[10];
for(int i=0;i<10;i++){
cin >> a[i];
}
Sort(a);
std::cout << a[0] << std::endl;
std::cout << a[1] << std::endl;
std::cout << a[2] << std::endl;
}
|
a.cc: In function 'int main()':
a.cc:24:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
24 | cin >> a[i];
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
|
s610300642
|
p00001
|
C++
|
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
class Main{
public static void main(String[] args)throws IOException{
int[] height=new int[10];
String[] st=new String[10];
File file=new File("in1.txt");
BufferedReader br=new BufferedReader(new BufferedReader(new FileReader(file)));
for(int i=0; i<10; i++){
st[i]=br.readLine();
height[i]=Integer.parseInt(st[i]);
if(height[i]<0){
height[i]*=-1;
}
}
int a=0; //a uses bubble sort
for(int j=0; j<9; j++){
for(int k=9; k>j; k--){
if(height[k]<height[k-1]){
a=height[k];
height[k]=height[k-1];
height[k-1]=a;
}
}
}
try{
PrintWriter pw=new PrintWriter
(new BufferedWriter(new FileWriter("out1.txt")));
for(int l=0; l<3; l++){
pw.println(height[9-l]);
}
pw.close();
}
catch(IOException e){
System.out.println("err");
}
}
}
|
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.BufferedWriter;
| ^~~~~~
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.io.File;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.io.FileReader;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import java.io.FileWriter;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import java.io.IOException;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
7 | import java.io.PrintWriter;
| ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:15: error: expected ':' before 'static'
11 | public static void main(String[] args)throws IOException{
| ^~~~~~~
| :
a.cc:11:33: error: 'String' has not been declared
11 | public static void main(String[] args)throws IOException{
| ^~~~~~
a.cc:11:42: error: expected ',' or '...' before 'args'
11 | public static void main(String[] args)throws IOException{
| ^~~~
a.cc:11:46: error: expected ';' at end of member declaration
11 | public static void main(String[] args)throws IOException{
| ^
| ;
a.cc:11:47: error: 'throws' does not name a type
11 | public static void main(String[] args)throws IOException{
| ^~~~~~
a.cc:55:2: error: expected ';' after class definition
55 | }
| ^
| ;
|
s807262415
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
#include <stdio.h>
#define pri(dt) printf("%d\n",dt)
#define RPE0(loopTotal) for(int i=0;i<=(loopTotal);i++)
#define RPE(loopTotal) for(int i=1;i<=(loopTotal);i++)
int data[9];
using namespace std;
int main(void){
RPE0(9) scanf("%d",&data[i]);
sort(data,data+9,greater<int>());
RPE0(2) pri(data[i]);
data[] = {0};
}
|
a.cc: In function 'int main()':
a.cc:13:25: error: reference to 'data' is ambiguous
13 | RPE0(9) scanf("%d",&data[i]);
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:8:5: note: 'int data [9]'
8 | int data[9];
| ^~~~
a.cc:14:10: error: reference to 'data' is ambiguous
14 | sort(data,data+9,greater<int>());
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:8:5: note: 'int data [9]'
8 | int data[9];
| ^~~~
a.cc:14:15: error: reference to 'data' is ambiguous
14 | sort(data,data+9,greater<int>());
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:8:5: note: 'int data [9]'
8 | int data[9];
| ^~~~
a.cc:15:17: error: reference to 'data' is ambiguous
15 | RPE0(2) pri(data[i]);
| ^~~~
a.cc:4:31: note: in definition of macro 'pri'
4 | #define pri(dt) printf("%d\n",dt)
| ^~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:8:5: note: 'int data [9]'
8 | int data[9];
| ^~~~
a.cc:16:1: error: reference to 'data' is ambiguous
16 | data[] = {0};
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:8:5: note: 'int data [9]'
8 | int data[9];
| ^~~~
a.cc:16:6: error: expected primary-expression before ']' token
16 | data[] = {0};
| ^
|
s178264131
|
p00001
|
C++
|
import java.util.*;
class Main{
public static void main(String[] a){
int[] h = new int[10]; //10??¶????????±?????\??????????????????????????£?¨?
Scanner s = new Scanner(System.in);
for(int i = 0; i < h.length; i++){
h[i] = s.nextInt();
}
Arrays.sort(h);
for(int i = 9; i >= 7; i--){
System.out.println(h[i]);
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
4 | public static void main(String[] a){
| ^~~~~~~
| :
a.cc:4:29: error: 'String' has not been declared
4 | public static void main(String[] a){
| ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'a'
4 | public static void main(String[] a){
| ^
a.cc:20:2: error: expected ';' after class definition
20 | }
| ^
| ;
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]; //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]; //10??¶????????±?????\??????????????????????????£?¨?
| ^
a.cc:8:9: error: 'Scanner' was not declared in this scope
8 | Scanner s = new Scanner(System.in);
| ^~~~~~~
a.cc:9:28: error: 'h' was not declared in this scope
9 | for(int i = 0; i < h.length; i++){
| ^
a.cc:10:20: error: 's' was not declared in this scope
10 | h[i] = s.nextInt();
| ^
a.cc:13:9: error: 'Arrays' was not declared in this scope
13 | Arrays.sort(h);
| ^~~~~~
a.cc:13:21: error: 'h' was not declared in this scope
13 | Arrays.sort(h);
| ^
a.cc:16:13: error: 'System' was not declared in this scope
16 | System.out.println(h[i]);
| ^~~~~~
|
s807439725
|
p00001
|
C++
|
class Main {
public static void main(String[] args) {
int a = 0,b = 0,c = 0,i,j;
for(i = 0; i < 10; i++) {
j = new java.util.Scanner(System.in).nextInt();
if(0 <= j && j <= 10000) {
if(j > a) {
c = b;
b = a;
a = j;
} else if(j > b) {
c = b;
b = j;
} else if(j > c) {
c = j;
}
} else {
i--;
}
}
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
}
|
a.cc:2:15: error: expected ':' before 'static'
2 | public static void main(String[] args) {
| ^~~~~~~
| :
a.cc:2:33: error: 'String' has not been declared
2 | public static void main(String[] args) {
| ^~~~~~
a.cc:2:42: error: expected ',' or '...' before 'args'
2 | public static void main(String[] args) {
| ^~~~
a.cc:25:2: error: expected ';' after class definition
25 | }
| ^
| ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:41: error: 'java' does not name a type
5 | j = new java.util.Scanner(System.in).nextInt();
| ^~~~
a.cc:21:17: error: 'System' was not declared in this scope
21 | System.out.println(a);
| ^~~~~~
|
s938578334
|
p00001
|
C++
|
import java.util.*;
public class Main{
public static void main(String[] args){
int[] hill={0,0,0,0,0,0,0,0,0,0};
for(int j=0;j<=9;j++){
hill[j]=new Scanner(System.in).nextInt();
}
int key;
int flag;
for(key=9;key>=0;key--){
for(int i=0;i<=key-1;i++){
if(hill[i]>hill[i+1]){
flag=hill[i];hill[i]=hill[i+1];hill[i+1]=flag;
}
}
}
System.out.println(hill[9]);
System.out.println(hill[8]);
System.out.println(hill[7]);
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s437294199
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int hill[15];
for(int j=0;j<=8;j++){
cin>>hill[j];
}
int key;
int flag;
sort(hill,hill+10);
//sort
/*for(key=9;key>=0;key--){
for(int i=0;i<=key;i++){
if(hill[i]>hill[i+1]){
flag=hill[i];hill[i]=hill[i+1];hill[i+1]=flag;
}
}
}*/
cout<<hill[9]<<"\n"<<hill[8]<<"\n"<<hill[7]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'short'?
15 | sort(hill,hill+10);
| ^~~~
| short
|
s728020042
|
p00001
|
C++
|
#include<iostream>
int main(){
int a[10];
for(int i=0;i<10;i++){
scanf("%d",&a[i]);
}
int first=-1;
int second=-1;
int third=-1;
for(int j=0;j<10;j++){
if(a[j]>first){
first=a[j];
}
else if(a[j]>second){
second=a[j];
}
else if(a[j]>third){
third=a[j];
}
cout<<first<<endl;
cout<<second<<endl;
cout<<third<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
20 | cout<<first<<endl;
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:20:38: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
20 | cout<<first<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s806830939
|
p00001
|
C++
|
include<iostream>
using namespace std;
int main(){
int tall[10],no1=0,no2=0,no3=0,i=0;
for(i=0;i<=9;i++){
cin>>tall[i];
}
for(i=0;i<=9;i++){
if(tall[i]>=no1){
no3=no2;
no2=no1;
no1=tall[i];
}
if(tall[i]>=no2&&tall[i]<no1){
no3=no2;
no2=tall[i];
}
if(tall[i]>=no3&&tall[i]<no2){
no3=tall[i];
}
}
cout<<endl<<no1<<endl<<no2<<endl<<no3<<endl;
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
7 | cin>>tall[i];
| ^~~
a.cc:23:3: error: 'cout' was not declared in this scope
23 | cout<<endl<<no1<<endl<<no2<<endl<<no3<<endl;
| ^~~~
a.cc:23:9: error: 'endl' was not declared in this scope
23 | cout<<endl<<no1<<endl<<no2<<endl<<no3<<endl;
| ^~~~
|
s849339308
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int a[10];
for(int b =0;b<10;b++)
{
cin>>a[b]>>endl;
}
sort(a.begin(),a.end());
sort(a.begin(),a.end());
for(int c =0;c<3;c++)
cout<<a[c]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:26: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
11 | cin>>a[b]>>endl;
| ~~~~~~~~~^~~~~~
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>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/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>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/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>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/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>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/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>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/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>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/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>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'}
352 | operator>>(__streambuf_type* __sb);
|
s931360504
|
p00001
|
C++
|
#include<stdio.h>
??
void swap(int *x,int *y){
????????????????int temp;
??
????????????????temp=*x;
????????????????*x=*y;
????????????????*y=temp;
??
}
??
int main(void){
????????????????int i,j,k;
????????????????int height[10];
??
????????????????i=0;
??
????????????????while(scanf("%d",&height[i])==1){
????????????????????????????????i++;
????????????????????????????????if(i==10) break;
????????????????}
??
??
????????????????for(j=0;j<10;j++){
????????????????????????????????if(height[j]<0 || height[j]>10000){
????????????????????????????????????????????????height[j]=0;
????????????????????????????????}
????????????????}
??
??
??
????????????????for(i=0;i<10;i++){
????????????????????????????????for(j=0;j<10;j++){
????????????????????????????????????????????????if(height[i]<height[j]){
????????????????????????????????????????????????swap(&height[i],&height[j]);
????????????????????????????????????????????????}
????????????????????????????????}
????????????????}???????????? /*sort*/
??
????????????????printf("\n");
??
????????????????k=9;
??
??
????????????????while(1){
????????????????????????????????printf("%d\n",height[k]);
????????????????????????????????k--;
????????????????????????????????if(k==6) break;
????????????????}
??
??
??
??
????????????????return 0;
}
|
a.cc:2:1: error: expected unqualified-id before '?' token
2 | ??
| ^
a.cc:11:1: error: expected unqualified-id before '?' token
11 | ??
| ^
|
s497404682
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int>vec;
for(int i = 0;i < 10;++i)
{
int v; cin << v;
vec.push_back(v);
}
sort(vec.begin(),vec.end());
cout << vec[9] <<endl<< vec[8] <<endl << vec[7] <<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:20: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
8 | int v; cin << v;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:8:20: note: candidate: 'operator<<(int, int)' (built-in)
8 | int v; cin << v;
| ~~~~^~~~
a.cc:8:20: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:8:16: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
8 | int v; cin << v;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | int v; cin << v;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | int v; cin << v;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | int v; cin << v;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:8:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | int v; cin << v;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
|
s826145007
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
??
using namespace std;
??
??
int main(){
????????int a[10];
????????for(int i=0;i<10;i++){
????????????????cin>>a[i];
????????}
????????sort(a,a+10);
??
????????cout<<a[9]<<endl<<a[8]<<endl<<a[7]<<endl;
??
}
|
a.cc:3:1: error: expected unqualified-id before '?' token
3 | ??
| ^
a.cc:5:1: error: expected unqualified-id before '?' token
5 | ??
| ^
|
s896661309
|
p00001
|
C++
|
#include "stdafx.h"
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
vector<int> heights;
for (int i = 0; i < 10; i++) {
int height;
cin >> height;
heights.push_back(height);
}
sort(heights.rbegin(), heights.rend());
for (int i = 0; i < 3; i++) {
cout << heights[i] << endl;
}
}
|
a.cc:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s274215475
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
array<int,10> h{};
int in{};
for(int i=0;i<10;i++){
cin>>in;
h[i]=in;
}
sort(h.begin(),h.end());
cout<<h[9]<<endl;cout<<h[8]<<endl;cout<<h[7]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:19: error: variable 'std::array<int, 10> h' has initializer but incomplete type
5 | array<int,10> h{};
| ^
a.cc:2:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
1 | #include<iostream>
+++ |+#include <array>
2 | using namespace std;
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
11 | sort(h.begin(),h.end());
| ^~~~
| short
|
s353735501
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
vector<int> h();
int in{};
for(int i=0;i<10;i++){
cin>>in;
h.push_back(in);
}
sort(h.begin(),h.end());
cout<<h[9]<<endl;cout<<h[8]<<endl;cout<<h[7]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:18: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
7 | vector<int> h();
| ^~
a.cc:11:11: error: request for member 'push_back' in 'h', which is of non-class type 'std::vector<int>()'
11 | h.push_back(in);
| ^~~~~~~~~
a.cc:13:12: error: request for member 'begin' in 'h', which is of non-class type 'std::vector<int>()'
13 | sort(h.begin(),h.end());
| ^~~~~
a.cc:13:22: error: request for member 'end' in 'h', which is of non-class type 'std::vector<int>()'
13 | sort(h.begin(),h.end());
| ^~~
a.cc:14:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
14 | cout<<h[9]<<endl;cout<<h[8]<<endl;cout<<h[7]<<endl;
| ^
a.cc:14:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
14 | cout<<h[9]<<endl;cout<<h[8]<<endl;cout<<h[7]<<endl;
| ^
a.cc:14:48: warning: pointer to a function used in arithmetic [-Wpointer-arith]
14 | cout<<h[9]<<endl;cout<<h[8]<<endl;cout<<h[7]<<endl;
| ^
|
s147657548
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
vector<int> h();
int in{};
for(int i=0;i<10;i++){
cin>>in;
h.push_back(in);
}
sort(h.begin(),h.end());
cout<<h[9]<<endl;cout<<h[8]<<endl;cout<<h[7]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:18: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
7 | vector<int> h();
| ^~
a.cc:11:11: error: request for member 'push_back' in 'h', which is of non-class type 'std::vector<int>()'
11 | h.push_back(in);
| ^~~~~~~~~
a.cc:13:12: error: request for member 'begin' in 'h', which is of non-class type 'std::vector<int>()'
13 | sort(h.begin(),h.end());
| ^~~~~
a.cc:13:22: error: request for member 'end' in 'h', which is of non-class type 'std::vector<int>()'
13 | sort(h.begin(),h.end());
| ^~~
a.cc:14:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
14 | cout<<h[9]<<endl;cout<<h[8]<<endl;cout<<h[7]<<endl;
| ^
a.cc:14:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
14 | cout<<h[9]<<endl;cout<<h[8]<<endl;cout<<h[7]<<endl;
| ^
a.cc:14:48: warning: pointer to a function used in arithmetic [-Wpointer-arith]
14 | cout<<h[9]<<endl;cout<<h[8]<<endl;cout<<h[7]<<endl;
| ^
|
s912637377
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> v;
int h;
while (cin >> h) {
v.push_back(h);
}
sort(v.begin, v.end);
int s = v.size();
cout << v[s-1] << endl << v[s-2] << endl << v[s-3] << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:7: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
9 | sort(v.begin, v.end);
| ~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/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: template argument deduction/substitution failed:
a.cc:9:7: note: couldn't deduce template parameter '_RAIter'
9 | sort(v.begin, v.end);
| ~~~~^~~~~~~~~~~~~~~~
/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, 2 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, 2 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, 2 provided
|
s145799564
|
p00001
|
C++
|
A=[]
for i in range(10):
A.append(int(input()))
A.sort()
A.reverse()
for i in range(3):
print(A[i])
|
a.cc:1:1: error: 'A' does not name a type
1 | A=[]
| ^
|
s444032957
|
p00001
|
C++
|
A=[]
for i in range(10):
A.append(int(input()))
A.sort()
A.reverse()
for i in range(3):
print(A[i])
|
a.cc:1:1: error: 'A' does not name a type
1 | A=[]
| ^
|
s171102253
|
p00001
|
C++
|
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[]args){
ListOfTop3Hills();
}
public static void QQ(){
for(int i=1;i<10;i++){
for(int j=1;j<10;j++)System.out.println(i+"x"+j+"="+(i*j));
}
}
public static void ListOfTop3Hills(){
Scanner scan = new Scanner(System.in);
List<Integer> list = new ArrayList<Integer>();
for(int i=0;i<10;i++)list.add(scan.nextInt());
Collections.sort(list);
System.out.print(list.get(9)+"\n"+list.get(8)+"\n"+list.get(7));
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.List;
| ^~~~~~
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.ArrayList;
| ^~~~~~
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.Collections;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.util.Scanner;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
6 | public class Main {
| ^~~~~~
|
s075791676
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a,b,c,d,e,f,g,h,i,j;
int yama[10] = { a, b, c, d, e, f, g, h, i, j}
sort(yama, yama+10)
cout << yama[0] << endl;
cout << yama[1] << endl;
cout << yama[2] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:9: error: expected ',' or ';' before 'sort'
8 | sort(yama, yama+10)
| ^~~~
|
s920892072
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int num = 0;
int mountains[10] = { 0 };
for (int i = 0; i < 10; i++){
cin >> mountains[i];
}
sort(mountains[0],mountains[9]);
cout << mountains[0] << endl;
cout << mountains[1] << endl;
cout << mountains[2] << endl;
return 0;
}
|
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_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:10:6: required from here
10 | sort(mountains[0],mountains[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:10:6: required from here
10 | sort(mountains[0],mountains[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:10:6: required from here
10 | sort(mountains[0],mountains[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:10:6: required from here
10 | sort(mountains[0],mountains[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;
| ^~~~~~~~~~~~
|
s126998949
|
p00001
|
C++
|
#include<cstdio>
#include<algorithm>
#include<array>
using namespace std;
int main(){
array<int,10> xs;
for(int i=0;i<10;++i)scanf("%d",&xs[i]);
sort(xs.begin(),xs.end(),greater<int>());
for(int i=0;i<3;++i)printf("%d",xs[i]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:28: error: 'greater' was not declared in this scope
9 | sort(xs.begin(),xs.end(),greater<int>());
| ^~~~~~~
a.cc:9:36: error: expected primary-expression before 'int'
9 | sort(xs.begin(),xs.end(),greater<int>());
| ^~~
|
s733433574
|
p00001
|
C++
|
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int a[9];
for(int i=0;i<=9;i++){
cin>>a[i];
}
sort(a[0],a[9]);
cout<<a[9]<<a[8]<<a[7]<<endl;
return 0;
}
|
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/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:11:7: required from here
11 | sort(a[0],a[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:11:7: required from here
11 | sort(a[0],a[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:11:7: required from here
11 | sort(a[0],a[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:11:7: required from here
11 | sort(a[0],a[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);
|
|
s856396514
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a[10],i=1;
cin << i;
while(cin >> a[i]){
i++
}
sort(a,a+i);
cout << a[i-1] << endl;
cout << a[n-2] << endl;
cout << a[i-3] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << i;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:7: note: candidate: 'operator<<(int, int)' (built-in)
7 | cin << i;
| ~~~~^~~~
a.cc:7:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << i;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:7:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
7 | cin << i;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << i;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:7:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << i;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:7:10: required from here
7 | cin << i;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:9:8: error: expected ';' before '}' token
9 | i++
| ^
| ;
10 | }
| ~
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
11 | sort(a,a+i);
| ^~~~
| short
a.cc:13:13: error: 'n' was not declared in this scope
13 | cout << a[n-2] << endl;
| ^
|
s526525448
|
p00001
|
C++
|
#include <stdio.h>
??
int main(void)
{
????????int yama[10],i,j;
????????for(i=0;i<10;i++){
????????????????scanf("%d",&yamja[i]);
????????}
????????for(i=0;i<10;i++){
????????????????for(j=0;j<10;j++){
????????????????????????if(yama[i]<yama[j]){
????????????????????????????????a=yama[i];
????????????????????????????????????????????????????????????????yama[i]=yama[j];
????????????????????????????????????????????????????????????????yama[j]=a;
}
}
}
for(i=0;i<3;i++){
printf("%d\n",yama[i]);
}
}
|
a.cc:2:1: error: expected unqualified-id before '?' token
2 | ??
| ^
|
s995506153
|
p00001
|
C++
|
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main(int argc, const char * argv[]) {
// input from txt
string filename = "input.txt";
ifstream fin(filename);
if(fin.fail()){
cout << "load fail...";
}
vector<int> heights(10);
for (int i=0; i<10; i++){
cin >> heights[i];
}
sort(heights.begin(), heights.end(), greater<int>());
for (int i=0; i<3; i++){
cout << heights[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
20 | sort(heights.begin(), heights.end(), greater<int>());
| ^~~~
| short
|
s042495841
|
p00001
|
C++
|
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main(int argc, const char * argv[]) {
if(fin.fail()){
cout << "load fail...";
}
vector<int> heights(10);
for (int i=0; i<10; i++){
cin >> heights[i];
}
sort(heights.begin(), heights.end(), greater<int>());
for (int i=0; i<3; i++){
cout << heights[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:8:8: error: 'fin' was not declared in this scope
8 | if(fin.fail()){
| ^~~
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
16 | sort(heights.begin(), heights.end(), greater<int>());
| ^~~~
| short
|
s340866067
|
p00001
|
C++
|
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, const char * argv[]) {
if(fin.fail()){
cout << "load fail...";
}
vector<int> heights(10);
for (int i=0; i<10; i++){
cin >> heights[i];
}
sort(heights.begin(), heights.end(), greater<int>());
for (int i=0; i<3; i++){
cout << heights[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:9:8: error: 'fin' was not declared in this scope
9 | if(fin.fail()){
| ^~~
|
s692497631
|
p00001
|
C++
|
#include <iostream>
using namespace std;
class top3
{
private:
int idx;
int x;
int y;
int hill[10];
int top[3];
public:
void empty(){
idx=0;
y=0;
x=10;
}
void push(int v){
hill[idx++]=v;
}
int pop(){
int i;
top[y]=hill[i];
for(i=0;i<x;i++){
if(hill[i]>top[y]) {top[y]=hill[i];
}
x--;
return top[y++];
};
};
int main(){
top3 a;
int n,v;
cin>>n;
a.empty();
for(int i=0;i<n;i++){
cin>>v;
a.push(v);
}
for(int i=0;i<n;i++){
cout<<a.pop()<<endl;
}
return 0;
}
|
a.cc:48:8: error: expected '}' at end of input
48 | }
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
a.cc:48:8: error: expected unqualified-id at end of input
48 | }
| ^
|
s048841331
|
p00001
|
C++
|
#include <iostream>
#include <cstdlib>
#include <fstream>
int main(int argc, char *argv[]){
// std::ifstream datafile(argv[1]); //input datafile
std::string str;
int mt_height[10] = {}; //height of mountain
int ans[3] = {}; // top 3 height of mountain. 0 -> no.1 1 -> no.2 2 -> no.3
if(datafile.fail()){
std::cout << "error : can't open this file." << std::endl;
exit(1);
}
//input 10 height of mountain
for(size_t i = 0; i < 10; i++){
std::getline(std::cin, str);
sscanf(str.c_str(), "%d", &mt_height[i]);
if((mt_height[i] < 0) || (mt_height[i] > 10000)){
std::cout << "error : out of constraints" << std::endl;
exit(1);
}
}
//select top 3 height of mountain and sort ans[]
for(size_t i = 0; i < 10; i++){
if(ans[0] < mt_height[i]){
ans[2] = ans[1];
ans[1] = ans[0];
ans[0] = mt_height[i];
}else if(ans[1] < mt_height[i]){
ans[2] = ans[1];
ans[1] = mt_height[i];
}else if(ans[2] < mt_height[i]){
ans[2] = mt_height[i];
}
}
//output ans[]
for(size_t i = 0; i < 3; i++){
std::cout << ans[i] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main(int, char**)':
a.cc:11:12: error: 'datafile' was not declared in this scope
11 | if(datafile.fail()){
| ^~~~~~~~
|
s105878280
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int mountain[10];
cin << mountain[10];
sort(mountain[10]);
cout << mountain[1] << endl;
cout << mountain[2] << endl;
cout << mountain[3] << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
8 | cin << mountain[10];
| ~~~ ^~ ~~~~~~~~~~~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:8:7: note: candidate: 'operator<<(int, int)' (built-in)
8 | cin << mountain[10];
| ~~~~^~~~~~~~~~~~~~~
a.cc:8:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin << mountain[10];
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:8:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
8 | cin << mountain[10];
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin << mountain[10];
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:8:21: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:8:21: required from here
8 | cin << mountain[10];
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:9:7: error: no matching function for call to 'sort(int&)'
9 | sort(mountain[10]);
| ~~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
476
|
s326310800
|
p00001
|
C++
|
#include <bits/stdc+.h>
using namespace std;
int mountain[12]
int main() {
for (int i = 0; i < 10; ++i){
cin >> mountain[i];
}
sort(mountain,mountain+10)
cout << mountain[9] << endl
<< mountain[8] << endl
<< mountain[7] << endl;
}
|
a.cc:1:10: fatal error: bits/stdc+.h: No such file or directory
1 | #include <bits/stdc+.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s792424316
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int mountain[12]
int main() {
for (int i = 0; i < 10; ++i){
cin >> mountain[i];
}
sort(mountain,mountain+10)
cout << mountain[9] << endl
<< mountain[8] << endl
<< mountain[7] << endl;
}
|
a.cc:6:1: error: expected initializer before 'int'
6 | int main() {
| ^~~
|
s307802570
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main() {
int a[10];
for(int i = 0; i < 10; ++i) {
cin >> a[i] >> endl;
}
for(int i = 0; i < 10; ++i) {
for(int j = 9; j > i; --j) {
if(a[j] < a [j - 1]) {
int t = a[j];
a[j] = a[j - 1];
a[j - 1] = t;
}
}
}
for(int i = 9; i > 6 ; --i) {
cout << a[i] << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:7:17: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
7 | cin >> a[i] >> endl;
| ~~~~~~~~~~~~^~~~~~~
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>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/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>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/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>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/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>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/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>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/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>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/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>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'}
352 | operator>>(__streambuf_type* __sb);
|
|
s941480330
|
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
| ^~~~
|
s011150735
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int x[10001],i;
for(i=0;0<=i && i<=10000;++i){
cin>>x[i];
}
sort(x);
cout<<x[0]<<endl;
cout<<x[1]<<endl;
cout<<x[2]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:9: error: no matching function for call to 'sort(int [10001])'
9 | 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
|
s535276863
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int x[10],i;
for(i=0;0<=i && i<10;++i){
cin>>x[i];
}
sort(x);
cout<<x[0]<<endl;
cout<<x[1]<<endl;
cout<<x[2]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:9: error: no matching function for call to 'sort(int [10])'
10 | 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
|
s110316396
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a[10];
for(int i = 0;i < 10;i++) cin >> a[i];
sort(a,a + n,greater<int>());
for(int i = 0;i < 3;i++) cout << a[i] << endl;
}
|
a.cc: In function 'int main()':
a.cc:8:12: error: 'n' was not declared in this scope
8 | sort(a,a + n,greater<int>());
| ^
|
s299273564
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int i,h,m1,m2,m3;
m1=0;
m2=0;
m3=0;
for(i=0;i<10;i++)
{
cin>>h;
if(h>m1)
{
m3=m2;
m2=m1;
m1=h;
}
else if(h>m2)
{
m3=m2;
m2=h;
}
else if(h>m3)
{
m3=h;
}
}
cout<<m1<<endl;
cout<<m2<<endl;
cout<<m3;
return 0
}
|
a.cc: In function 'int main()':
a.cc:31:9: error: expected ';' before '}' token
31 | return 0
| ^
| ;
32 | }
| ~
|
s024048194
|
p00001
|
C++
|
#include<bits/stdc++.stdc>
using namespace std;
int main(){
int a[10];
for(int i =0; i < 10; i++){
cin >> a[i];
}
sort( a, a + 10, greater<int>());
for(int j = 0; j < 3; j++){
cout << a[j] << endl;
}
return 0;
}
|
a.cc:1:9: fatal error: bits/stdc++.stdc: No such file or directory
1 | #include<bits/stdc++.stdc>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
|
s144536391
|
p00001
|
C++
|
#include <iostream>
using namespace std;
#define INPUTSIZE 10
int main() {
int inputs[INPUTSIZE];
for (int i = 0; i < INPUTSIZE; i++) cin >> inputs[i];
sort(inputs, inputs + INPUTSIZE);
for (int i = 1; i <= 3; i++) cout << inputs[INPUTSIZE - i] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(inputs, inputs + INPUTSIZE);
| ^~~~
| short
|
s973694472
|
p00001
|
C++
|
/*
* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0001
*/
#include <iostream>
#include <vector>
#define COUNT 10
using namespace std;
int
main()
{
vector<int> heights(COUNT);
for (int i = 0; i < COUNT; i++) {
cin >> heights[i];
cin.ignore();
}
sort(heights.begin(), heights.end(), greater<int>());
for (int i = 0; i < 3; i++)
cout << heights[i] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'short'?
18 | sort(heights.begin(), heights.end(), greater<int>());
| ^~~~
| short
|
s069693307
|
p00001
|
C++
|
mt = list()
for i in range(10):
mt.append(int(raw_input()))
mt = sorted(mt,reverse=True)
for i in range(3):
print mt[i]
|
a.cc:1:1: error: 'mt' does not name a type
1 | mt = list()
| ^~
|
s982147084
|
p00001
|
C++
|
#include<bits/stdc++.h>
using namespace std;
__int128 a[15];
int main(){
for(int i=0;i<10;i++){
cin>>a[i];
}
sort(a, a+10);
cout<<a[9]<<endl
<<a[8]<<endl
<<a[7]<<endl;
}
|
a.cc: In function 'int main()':
a.cc:8:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__int128')
8 | cin>>a[i];
| ~~~^~~~~~
| | |
| | __int128
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
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:8:17: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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>]' (near match)
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: cannot bind non-const lvalue reference of type 'float&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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>]' (near match)
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: cannot bind non-const lvalue reference of type 'double&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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>]' (near match)
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: invalid conversion from '__int128' to 'void*' [-fpermissive]
8 | cin>>a[i];
| ~~~^
| |
| __int128
a.cc:8:17: error: cannot bind rvalue '(void*)((long int)a[i])' to 'void*&'
/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>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
8 | cin>>a[i];
| ~~~^
| |
| __int128
/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>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive]
8 | cin>>a[i];
| ~~~^
| |
| __int128
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istrea
|
s639031344
|
p00001
|
C++
|
#include<bits/stdc++.h>
using namespace std;
__int128_t a[15];
int main(){
for(int i=0;i<10;i++){
cin>>a[i];
}
sort(a, a+10);
cout<<a[9]<<endl
<<a[8]<<endl
<<a[7]<<endl;
}
|
a.cc: In function 'int main()':
a.cc:8:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__int128')
8 | cin>>a[i];
| ~~~^~~~~~
| | |
| | __int128
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
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:8:17: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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>]' (near match)
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: cannot bind non-const lvalue reference of type 'float&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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>]' (near match)
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: cannot bind non-const lvalue reference of type 'double&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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>]' (near match)
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: invalid conversion from '__int128' to 'void*' [-fpermissive]
8 | cin>>a[i];
| ~~~^
| |
| __int128
a.cc:8:17: error: cannot bind rvalue '(void*)((long int)a[i])' to 'void*&'
/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>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
8 | cin>>a[i];
| ~~~^
| |
| __int128
/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>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive]
8 | cin>>a[i];
| ~~~^
| |
| __int128
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istrea
|
s958221498
|
p00001
|
C++
|
#include<bits/stdc++.h>
using namespace std;
__int128_t a[15];
int main(){
for(int i=0;i<10;i++){
cin>>a[i];
}
sort(a, a+10);
cout<<a[9]<<endl
<<a[8]<<endl
<<a[7]<<endl;
}
|
a.cc: In function 'int main()':
a.cc:8:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__int128')
8 | cin>>a[i];
| ~~~^~~~~~
| | |
| | __int128
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
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:8:17: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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>]' (near match)
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: cannot bind non-const lvalue reference of type 'float&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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>]' (near match)
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: cannot bind non-const lvalue reference of type 'double&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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>]' (near match)
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type '__int128'
8 | cin>>a[i];
| ~~~^
/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:8:17: error: invalid conversion from '__int128' to 'void*' [-fpermissive]
8 | cin>>a[i];
| ~~~^
| |
| __int128
a.cc:8:17: error: cannot bind rvalue '(void*)((long int)a[i])' to 'void*&'
/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>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
8 | cin>>a[i];
| ~~~^
| |
| __int128
/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>]' (near match)
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:17: error: invalid conversion from '__int128' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive]
8 | cin>>a[i];
| ~~~^
| |
| __int128
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istrea
|
s595735752
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <string>
int main() {
std::vector<int> hills;
for (int i = 0; i < 10; i++) {
std::cout << i << std::endl;
std::string input;
std::cin >> input;
int height = std::atoi(input.c_str());
hills.push_back(height);
}
std::sort(hills.begin(), hills.end(), std::greater<int>());
for (int i = 0; i < 3; i++) {
std::cout << hills[i] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
15 | std::sort(hills.begin(), hills.end(), std::greater<int>());
| ^~~~
| qsort
|
s682510353
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <string>
int main() {
std::vector<int> hills;
for (int i = 0; i < 10; i++) {
std::cout << i << std::endl;
std::string input;
std::cin >> input;
int height = std::stoi(input);
hills.push_back(height);
}
std::sort(hills.begin(), hills.end(), std::greater<int>());
for (int i = 0; i < 3; i++) {
std::cout << hills[i] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
15 | std::sort(hills.begin(), hills.end(), std::greater<int>());
| ^~~~
| qsort
|
s989287828
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <string>
int main() {
std::vector<int> hills;
for (int i = 0; i < 10; i++) {
std::cout << i << std::endl;
std::string input;
std::cin >> input;
int height = std::stoi(input);
hills.push_back(height);
}
std::sort(hills.begin(), hills.end(), std::greater<int>());
for (int i = 0; i < 3; i++) {
std::cout << hills[i] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
15 | std::sort(hills.begin(), hills.end(), std::greater<int>());
| ^~~~
| qsort
|
s482027829
|
p00001
|
C++
|
#include <cstdio>
#include <algorithm>
using namespace std;
int reverse(int x,int y){
return x>y;
}
int main(){
int i;
int mount[10];
int *p=&mount[0];
for(i=0;i<10;i++){
scanf("%d\n",p);
p++;
}
sort(mount,mount+10,reverse(x,y));
printf("%d\n%d\n%d\n",mount[0],mount[1],mount[2]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:33: error: 'x' was not declared in this scope
16 | sort(mount,mount+10,reverse(x,y));
| ^
a.cc:16:35: error: 'y' was not declared in this scope
16 | sort(mount,mount+10,reverse(x,y));
| ^
|
s549845445
|
p00001
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int h[9]
int main(){
for(i=0;i<=9;i++){
cin>>h[i];
}
sort(h, h+10, greater<int>());
cout<<h[0]<<h[1]<<h[2];
return 0;
}
|
a.cc:6:1: error: expected initializer before 'int'
6 | int main(){
| ^~~
|
s714388719
|
p00001
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int h[9]
for(int i=0;i<=9;i++){
cin>>h[i];
}
sort(h, h+10, greater<int>());
cout<<h[0]<<h[1]<<h[2];
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'for'
6 | for(int i=0;i<=9;i++){
| ^~~
a.cc:6:15: error: 'i' was not declared in this scope
6 | for(int i=0;i<=9;i++){
| ^
a.cc:10:8: error: 'h' was not declared in this scope
10 | sort(h, h+10, greater<int>());
| ^
|
s627708353
|
p00001
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int h[10];
int i;
for(i=0;i<10;i++){
scanf("%d",&h[i]);
}
sort(h, h+10);
printf("%d\n%d\n%d\n",a[9],a[8],a[7]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:25: error: 'a' was not declared in this scope
13 | printf("%d\n%d\n%d\n",a[9],a[8],a[7]);
| ^
|
s777732620
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
int i;
vector<int> v;
while(getline(cin, num)){
v.push_back(num);
}
sort(v.begin(), v.end());
for(int i = 1; i < 4; i++){
cout << v[v.size - i] << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:9:24: error: 'num' was not declared in this scope; did you mean 'enum'?
9 | while(getline(cin, num)){
| ^~~
| enum
a.cc:14:21: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
14 | cout << v[v.size - i] << endl;
| ~~^~~~
| ()
|
s719865358
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
int i;
vector<int> v;
while(getline(cin, num)){
v.push_back(num);
}
sort(v.begin(), v.end());
for(int i = 1; i < 4; i++){
cout << v[v.size - i] << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:9:24: error: 'num' was not declared in this scope; did you mean 'enum'?
9 | while(getline(cin, num)){
| ^~~
| enum
a.cc:14:21: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
14 | cout << v[v.size - i] << endl;
| ~~^~~~
| ()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.