submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s756337142
|
p00001
|
C++
|
#include <iostream>
int main()
{
using namespace std;
int max = 0;
int second = 0;
int third = 0;
int n[10];
for(int i = 0; i < 10; i++) cin >> n[i];
sort(n,n+10,greater<int>());
max = n[0];
second = n[1];
third = n[2];
cout << max << "\n" << second << "\n" << third << "\n";
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(n,n+10,greater<int>());
| ^~~~
| short
|
s041089555
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
int main(){
std::vector<int> vech;
for(int i = 0; i < 10; i++){
std::cin >> vec[i];
}
std::sort(vec.begin(), vec.end(), std::greater<int>());
for(int i = 0; i < 3; i++){
std::cout << vec[i] << std::endl;
}
}
|
a.cc: In function 'int main()':
a.cc:8:17: error: 'vec' was not declared in this scope; did you mean 'vech'?
8 | std::cin >> vec[i];
| ^~~
| vech
a.cc:10:13: error: 'vec' was not declared in this scope; did you mean 'vech'?
10 | std::sort(vec.begin(), vec.end(), std::greater<int>());
| ^~~
| vech
|
s754946293
|
p00001
|
C++
|
#include<stdio.h>
int main(void)
{
int mount;
for(int f1=0;f1<10;f1++){
scanf("%d",&mount[f1]);
}
int mem;
for(int f1=0;f1<10;f1++){
for(int f2=0;f2<10;f2++){
if(mount[f1]>mount[f2]){
mem=mount[f1];
mount[f1]=mount[f2];
mount[f2]=mem;
}
}
}
for(int f1=0;f1<3;f1++){
printf("%d\n",mount[f1]);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:18: error: invalid types 'int[int]' for array subscript
6 | scanf("%d",&mount[f1]);
| ^
a.cc:11:9: error: invalid types 'int[int]' for array subscript
11 | if(mount[f1]>mount[f2]){
| ^
a.cc:11:19: error: invalid types 'int[int]' for array subscript
11 | if(mount[f1]>mount[f2]){
| ^
a.cc:12:10: error: invalid types 'int[int]' for array subscript
12 | mem=mount[f1];
| ^
a.cc:13:6: error: invalid types 'int[int]' for array subscript
13 | mount[f1]=mount[f2];
| ^
a.cc:13:16: error: invalid types 'int[int]' for array subscript
13 | mount[f1]=mount[f2];
| ^
a.cc:14:6: error: invalid types 'int[int]' for array subscript
14 | mount[f2]=mem;
| ^
a.cc:19:20: error: invalid types 'int[int]' for array subscript
19 | printf("%d\n",mount[f1]);
| ^
|
s130210999
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int m;
int m1=0,m2=0,m3=0;
for(int i=0;i<10i++){
cin << m << endl;
if(m1>m){
m3 = m2;
m2 = m1;
m1 = m;
}
else if(m2>m){
m3 = m2;
m2 = m;
}
else if(m3>m){
m3 = m2;
}
}
cout << m1 << endl << m2 << endl << m3 <<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:20: error: lvalue required as increment operand
6 | for(int i=0;i<10i++){
| ^~
a.cc:6:22: error: expected ';' before ')' token
6 | for(int i=0;i<10i++){
| ^
| ;
a.cc:7:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
7 | cin << m << endl;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:7:9: note: candidate: 'operator<<(int, int)' (built-in)
7 | cin << m << endl;
| ~~~~^~~~
a.cc:7:9: 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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << m << 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: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:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
7 | cin << m << endl;
| ^~~
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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << m << endl;
| ^
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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << m << endl;
| ^
/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:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
7 | cin << m << endl;
| ^
/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:12: required from here
7 | cin << m << endl;
| ^
/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)
| ^~~~~~~~
|
s508324523
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
int main() {
vector<int> v;
for(int i = 0; i < 10; ++i) {
int a;
cin >> a;
v.push_back(a);
}
sort(v.begin(), v.end(), greater<int>());
for(int i = 0; i < 3; ++i) cout << v[i] << endl;
return 0;
}
#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
int main() {
vector<int> v;
for(int i = 0; i < 10; ++i) {
int a;
cin >> a;
v.push_back(a);
}
sort(v.begin(), v.end(), greater<int>());
for(int i = 0; i < 3; ++i) cout << v[i] << endl;
return 0;
}
|
a.cc:24:5: error: redefinition of 'int main()'
24 | int main() {
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main() {
| ^~~~
|
s756500527
|
p00001
|
C++
|
#include<iostream>
using namespace std;
void main()
{
int h[10];
int i,j,t;
for(i=0;i<10;i++)
cin>>h[i];
for(j=0;j<3;j++)
{
for(i=j+1;i<9;i++)
{
if(h[j]<h[i])
{
t=h[j];
h[j]=h[i];
h[i]=t;
}
}
}
for(i=0;i<3;i++)
cout<<h[i]<<endl;
}
|
a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
|
s459834372
|
p00001
|
C++
|
#include<iostream>
using namespace std;
void main()
{
int h[10];
int i,j,t;
for(i=0;i<10;i++)
cin>>h[i];
for(j=0;j<3;j++)
{
for(i=j+1;i<10;i++)
{
if(h[j]<h[i])
{
t=h[j];
h[j]=h[i];
h[i]=t;
}
}
cout<<h[j]<<endl;
}
}
|
a.cc:3:1: error: '::main' must return 'int'
3 | void main()
| ^~~~
|
s491717920
|
p00001
|
C++
|
#include <iostream>
#include <functional>
#include <string>
using namespace std;
int main(){
int i;
int high[10];
for(i = 0; i < 10; i++){
high[i] << cin;
}
partial_sort(high, high + 3, greater<int>());
cout << high[0] << endl
<< hiht[1] << endl
<< high[2] << endl;y
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:25: error: no match for 'operator<<' (operand types are 'int' and 'std::istream' {aka 'std::basic_istream<char>'})
10 | high[i] << cin;
| ~~~~~~~ ^~ ~~~
| | |
| int std::istream {aka std::basic_istream<char>}
a.cc:10:25: note: candidate: 'operator<<(int, int)' (built-in)
10 | high[i] << cin;
| ~~~~~~~~^~~~~~
a.cc:10:25: note: no known conversion for argument 2 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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
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:10:23: note: cannot convert 'high[i]' (type 'int') to type 'std::byte'
10 | high[i] << cin;
| ~~~~~~^
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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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 = int&; _Tp = std::basic_istream<char>]':
a.cc:10:28: required from here
10 | high[i] << cin;
| ^~~
/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:12:9: error: 'partial_sort' was not declared in this scope
12 | partial_sort(high, high + 3, greater<int>());
| ^~~~~~~~~~~~
a.cc:14:20: error: 'hiht' was not declared in this scope
14 | << hiht[1] << endl
| ^~~~
a.cc:15:36: error: 'y' was not declared in this scope
15 | << high[2] << endl;y
| ^
|
s645656990
|
p00001
|
C++
|
#include <iostream>
#include <functional>
#include <string>
using namespace std;
int main(){
int i;
int high[10];
for(i = 0; i < 10; i++){
high[i] << cin;
}
partial_sort(high, high + 3, greater<int>());
cout << high[0] << endl
<< hiht[1] << endl
<< high[2] << endl;y
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:25: error: no match for 'operator<<' (operand types are 'int' and 'std::istream' {aka 'std::basic_istream<char>'})
10 | high[i] << cin;
| ~~~~~~~ ^~ ~~~
| | |
| int std::istream {aka std::basic_istream<char>}
a.cc:10:25: note: candidate: 'operator<<(int, int)' (built-in)
10 | high[i] << cin;
| ~~~~~~~~^~~~~~
a.cc:10:25: note: no known conversion for argument 2 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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
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:10:23: note: cannot convert 'high[i]' (type 'int') to type 'std::byte'
10 | high[i] << cin;
| ~~~~~~^
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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
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:10:28: note: mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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:10:28: note: mismatched types 'std::basic_ostream<char, _Traits>' and 'int'
10 | high[i] << cin;
| ^~~
/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 = int&; _Tp = std::basic_istream<char>]':
a.cc:10:28: required from here
10 | high[i] << cin;
| ^~~
/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:12:9: error: 'partial_sort' was not declared in this scope
12 | partial_sort(high, high + 3, greater<int>());
| ^~~~~~~~~~~~
a.cc:14:20: error: 'hiht' was not declared in this scope
14 | << hiht[1] << endl
| ^~~~
a.cc:15:36: error: 'y' was not declared in this scope
15 | << high[2] << endl;y
| ^
|
s561963957
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int n[10],i=0;
while (cin >> n[i])
i++;
sort(n,n+i-1,greater<int>());
for (int j=0; j < 3; j++) {
cout << n[j] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(n,n+i-1,greater<int>());
| ^~~~
| short
|
s477226059
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int n[10],i=0;
while (cin >> n[i])
i++;
sort(n,n+i-1,greater<int>());
for (int j=0; j < 3; j++) {
cout << n[j] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(n,n+i-1,greater<int>());
| ^~~~
| short
|
s438556046
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int mnt[10];
int i;
int max;
for(i=0;i<10;i++)
{
cin>>mnt[i];
}
sort(mnt,mnt+10);
reverse(mnt,mnt+10);
for(i=0;i<3;i++) cout<<mnt[i]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:1: error: 'sort' was not declared in this scope; did you mean 'short'?
17 | sort(mnt,mnt+10);
| ^~~~
| short
a.cc:18:1: error: 'reverse' was not declared in this scope
18 | reverse(mnt,mnt+10);
| ^~~~~~~
|
s887874060
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int mnt[10];
int i;
for(i=0;i<10;i++)
{
cin>>mnt[i];
}
sort(mnt,mnt+10);
reverse(mnt,mnt+10);
for(i=0;i<3;i++)
cout<<mnt[i]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(mnt,mnt+10);
| ^~~~
| short
a.cc:13:1: error: 'reverse' was not declared in this scope
13 | reverse(mnt,mnt+10);
| ^~~~~~~
|
s347923681
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int D[10];
int i,k;
for(i=1; i<=10; i++)
{
cin>>D[i];
}
sort(D,D+10);
reverse(D,D+10);
for(k=1; k<=3; k++)
{
cout <<D[k]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:14: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(D,D+10);
| ^~~~
| short
a.cc:15:14: error: 'reverse' was not declared in this scope
15 | reverse(D,D+10);
| ^~~~~~~
|
s036689248
|
p00001
|
C++
|
#include<stdio.h>
#include<algorithm>
using std::sort;
main(){
int x[10];
for(i=0;i<10;i++)
scanf("%d",&x[i]);
sort(x,x+10);
printf("%d\n%d\n%d",x[9],x[8],x[7]);
}
|
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'i' was not declared in this scope
6 | for(i=0;i<10;i++)
| ^
|
s653774204
|
p00001
|
C++
|
#include<stdio.h>#include<algorithm>using std::sort;main(){int x[10],i;for(i=0;i<10;i++)scanf("%d",&x[i]);sort(x,x+10);printf("%d\n%d\n%d",x[9],x[8],x[7]);}
|
a.cc:1:18: warning: extra tokens at end of #include directive
1 | #include<stdio.h>#include<algorithm>using std::sort;main(){int x[10],i;for(i=0;i<10;i++)scanf("%d",&x[i]);sort(x,x+10);printf("%d\n%d\n%d",x[9],x[8],x[7]);}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s649970494
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int x;
int h[3];
for(int a=0;a<10;a++){
cin >> x;
if(x>h[0]){
h[2] = h[1];
h[1] = h[0];
h[0] = x;
}else if(x>h[1]){
h[2] = h[1];
h[1] = x;
}else if(x>h[2]){
h[2] = x;
}
}
cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ~~~~ ^~ ~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
a.cc:20:10: note: candidate: 'operator>>(int, int)' (built-in)
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ~~~~~^~~~~~~
a.cc:20:10: 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:20:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ^
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:20:5: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ^~~~
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:20:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ^
/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:20:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ^
/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:20:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ^
/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:20:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ^
/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:20:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ^
/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:20:16: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ^
/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:20:16: required from here
20 | cout >> h[0] >> "\n" h[1] >> "\n" h[2] >> "\n";
| ^
/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)
| ^~~~~~~~
|
s964166348
|
p00001
|
C++
|
#include<stdio.h>
int main(void){
/* 宣言と初期化 */
int hai[10];
int i;
int temp2nd;
int temp3rd
int tempmax;
for(i=0;i<10;i++)
{
printf("山の高さ ");
scanf("%d",hai[i]);
}
/* 代入 */
temp2nd=hai[0];
tempmax=hai[0];
temp3rd=hai[0]
/* 計算 */
for(i=0;i<=10;i++){
/* 最大値求める */
if(hai[i]>tempmax)
tempmax=hai[i];
}
for(i=0;i<=10;i++){
/*2番目求める */
if(hai[i]<tempmax&&hai[i]>temp2nd)
temp2nd=hai[i];
}
for(i=0;i<=10;i++){
/* 3番目求める */
if(hai[i]>temp3rd&&hai[i]<temp2nd)
temp3rd=hai[i];
}
/* 表示 */
printf("最も高い山の高さ %d\n",tempmax);
printf("2番目に高い山の高さ %d\n",temp2nd);
printf("3番目に高い山の高さ %d\n",temp3rd);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:5: error: expected initializer before 'int'
10 | int tempmax;
| ^~~
a.cc:19:5: error: 'tempmax' was not declared in this scope; did you mean 'tempnam'?
19 | tempmax=hai[0];
| ^~~~~~~
| tempnam
a.cc:20:5: error: 'temp3rd' was not declared in this scope; did you mean 'temp2nd'?
20 | temp3rd=hai[0]
| ^~~~~~~
| temp2nd
a.cc:23:22: error: expected ';' before ')' token
23 | for(i=0;i<=10;i++){
| ^
| ;
|
s081345186
|
p00001
|
C++
|
#include<stdio.h>
int main(void){
/* 宣言と初期化 */
int hai[10];
int i;
int temp2nd;
int temp3rd;
int tempmax;
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
/* 代入 */
temp2nd=hai[0];
tempmax=hai[0];
temp3rd=hai[0];
/* 計算 */
for(i=0;i<10;i++){
/* 最大値求める */
if(hai[i]>tempmax)
{ tempmax=hai[i];
hai[i]=0;}
}
for(i=0;i<10;i++){
/*2番目求める */
if(hai[i]<tempmax&&hai[i]>temp2nd)
{temp2nd=hai[i];hai[i]=0}
}
for(i=0;i<10;i++){
/* 3番目求める */
if(hai[i]>temp3rd&&hai[i]<temp2nd)
{temp3rd=hai[i];hai[i]=0}
}
/* 表示 */
printf("最も高い山の高さ %d\n",tempmax);
printf("2番目に高い山の高さ %d\n",temp2nd);
printf("3番目に高い山の高さ %d\n",temp3rd);
return 0;
}
|
a.cc:26:1: error: extended character is not valid in an identifier
26 | hai[i]=0;}
| ^
a.cc:26:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:26:1: error: '\U00003000\U00003000' was not declared in this scope
26 | hai[i]=0;}
| ^~~~
a.cc:32:33: error: expected ';' before '}' token
32 | {temp2nd=hai[i];hai[i]=0}
| ^
| ;
a.cc:38:33: error: expected ';' before '}' token
38 | {temp3rd=hai[i];hai[i]=0}
| ^
| ;
|
s391548043
|
p00001
|
C++
|
#include<stdio.h>
int main(void){
/* 宣言と初期化 */
int hai[10];
int id[2]
int i;
int temp2nd;
int temp3rd;
int tempmax;
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
/* 代入 */
temp2nd=hai[0];
tempmax=hai[0];
temp3rd=hai[0];
/* 計算 */
for(i=0;i<10;i++){
/* 最大値求める */
if(hai[i]>tempmax)
{ tempmax=hai[i];id[0]=i;}
}
for(i=0;i<10;i++){
/*2番目求める */
if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!hai[0])
{temp2nd=hai[i];hai[1]=i;}
}
for(i=0;i<10;i++){
/* 3番目求める */
if(hai[i]>temp3rd&&hai[i]<temp2nd&&i=!hai[1]&&i=!hai[0])
{temp3rd=hai[i];}
}
/* 表示 */
printf("最も高い山の高さ %d\n",tempmax);
printf("2番目に高い山の高さ %d\n",temp2nd);
printf("3番目に高い山の高さ %d\n",temp3rd);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:5: error: expected initializer before 'int'
8 | int i;
| ^~~
a.cc:13:5: error: 'i' was not declared in this scope
13 | for(i=0;i<10;i++)
| ^
a.cc:23:9: error: 'i' was not declared in this scope
23 | for(i=0;i<10;i++){
| ^
a.cc:26:25: error: 'id' was not declared in this scope; did you mean 'void'?
26 | { tempmax=hai[i];id[0]=i;}
| ^~
| void
a.cc:29:9: error: 'i' was not declared in this scope
29 | for(i=0;i<10;i++){
| ^
a.cc:35:9: error: 'i' was not declared in this scope
35 | for(i=0;i<10;i++){
| ^
|
s717968186
|
p00001
|
C++
|
#include<stdio.h>
int main(void){
/* 宣言と初期化 */
int hai[10];
int id[2]
int i;
int temp2nd;
int temp3rd;
int tempmax;
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
/* 代入 */
temp2nd=hai[0];
tempmax=hai[0];
temp3rd=hai[0];
/* 計算 */
for(i=0;i<10;i++){
/* 最大値求める */
if(hai[i]>tempmax)
{ tempmax=hai[i];id[0]=i;}
}
for(i=0;i<10;i++){
/*2番目求める */
if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!id[0])
{temp2nd=hai[i];hai[1]=i;}
}
for(i=0;i<10;i++){
/* 3番目求める */
if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
{temp3rd=hai[i];}
}
/* 表示 */
printf("最も高い山の高さ %d\n",tempmax);
printf("2番目に高い山の高さ %d\n",temp2nd);
printf("3番目に高い山の高さ %d\n",temp3rd);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:5: error: expected initializer before 'int'
8 | int i;
| ^~~
a.cc:13:5: error: 'i' was not declared in this scope
13 | for(i=0;i<10;i++)
| ^
a.cc:23:9: error: 'i' was not declared in this scope
23 | for(i=0;i<10;i++){
| ^
a.cc:26:25: error: 'id' was not declared in this scope; did you mean 'void'?
26 | { tempmax=hai[i];id[0]=i;}
| ^~
| void
a.cc:29:9: error: 'i' was not declared in this scope
29 | for(i=0;i<10;i++){
| ^
a.cc:31:47: error: 'id' was not declared in this scope; did you mean 'void'?
31 | if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!id[0])
| ^~
| void
a.cc:35:9: error: 'i' was not declared in this scope
35 | for(i=0;i<10;i++){
| ^
a.cc:37:51: error: 'id' was not declared in this scope; did you mean 'void'?
37 | if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
| ^~
| void
|
s954353576
|
p00001
|
C++
|
#include<stdio.h>
int main(void){
/* 宣言と初期化 */
int hai[10];
int id[2]
int i;
int temp2nd;
int temp3rd;
int tempmax;
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
/* 代入 */
temp2nd=hai[0];
tempmax=hai[0];
temp3rd=hai[0];
/* 計算 */
for(i=0;i<10;i++){
/* 最大値求める */
if(hai[i]>tempmax)
{ tempmax=hai[i];id[0]=i;}
}
for(i=0;i<10;i++){
/*2番目求める */
if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!id[0])
{temp2nd=hai[i];id[1]=i;}
}
for(i=0;i<10;i++){
/* 3番目求める */
if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
{temp3rd=hai[i];}
}
/* 表示 */
printf("最も高い山の高さ %d\n",tempmax);
printf("2番目に高い山の高さ %d\n",temp2nd);
printf("3番目に高い山の高さ %d\n",temp3rd);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:5: error: expected initializer before 'int'
8 | int i;
| ^~~
a.cc:13:5: error: 'i' was not declared in this scope
13 | for(i=0;i<10;i++)
| ^
a.cc:23:9: error: 'i' was not declared in this scope
23 | for(i=0;i<10;i++){
| ^
a.cc:26:25: error: 'id' was not declared in this scope; did you mean 'void'?
26 | { tempmax=hai[i];id[0]=i;}
| ^~
| void
a.cc:29:9: error: 'i' was not declared in this scope
29 | for(i=0;i<10;i++){
| ^
a.cc:31:47: error: 'id' was not declared in this scope; did you mean 'void'?
31 | if(hai[i]<tempmax&&hai[i]>temp2nd&&i=!id[0])
| ^~
| void
a.cc:35:9: error: 'i' was not declared in this scope
35 | for(i=0;i<10;i++){
| ^
a.cc:37:51: error: 'id' was not declared in this scope; did you mean 'void'?
37 | if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
| ^~
| void
|
s377952702
|
p00001
|
C++
|
#include<stdio.h>
int main(void){
/* 宣言と初期化 */
int hai[10];
int id[2]
int i;
int temp2nd;
int temp3rd;
int tempmax;
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
/* 代入 */
temp2nd=hai[0];
tempmax=hai[0];
temp3rd=hai[0];
/* 計算 */
for(i=0;i<10;i++){
/* 最大値求める */
if(hai[i]>tempmax)
{tempmax=hai[i];id[0]=i;}
}
for(i=0;i<10;i++){
/*2番目求める */
if(hai[i]<tempmax&&hai[i]>temp2nd&& i=! id[0])
{temp2nd=hai[i];id[1]=i;}
}
for(i=0;i<10;i++){
/* 3番目求める */
if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
{temp3rd=hai[i];}
}
/* 表示 */
printf("最も高い山の高さ %d\n",tempmax);
printf("2番目に高い山の高さ %d\n",temp2nd);
printf("3番目に高い山の高さ %d\n",temp3rd);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'int'
7 | int i;
| ^~~
a.cc:12:5: error: 'i' was not declared in this scope
12 | for(i=0;i<10;i++)
| ^
a.cc:21:9: error: 'i' was not declared in this scope
21 | for(i=0;i<10;i++){
| ^
a.cc:24:24: error: 'id' was not declared in this scope; did you mean 'void'?
24 | {tempmax=hai[i];id[0]=i;}
| ^~
| void
a.cc:26:9: error: 'i' was not declared in this scope
26 | for(i=0;i<10;i++){
| ^
a.cc:28:49: error: 'id' was not declared in this scope; did you mean 'void'?
28 | if(hai[i]<tempmax&&hai[i]>temp2nd&& i=! id[0])
| ^~
| void
a.cc:31:9: error: 'i' was not declared in this scope
31 | for(i=0;i<10;i++){
| ^
a.cc:33:51: error: 'id' was not declared in this scope; did you mean 'void'?
33 | if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
| ^~
| void
|
s498277898
|
p00001
|
C++
|
#include<stdio.h>
int main(void){
/* 宣言と初期化 */
int hai[10];
int id[2];
int i;
int temp2nd;
int temp3rd;
int tempmax;
for(i=0;i<10;i++)
{
scanf("%d",&hai[i]);
}
/* 代入 */
temp2nd=hai[0];
tempmax=hai[0];
temp3rd=hai[0];
/* 計算 */
for(i=0;i<10;i++){
/* 最大値求める */
if(hai[i]>tempmax)
{tempmax=hai[i];id[0]=i;}
}
for(i=0;i<10;i++){
/*2番目求める */
if(hai[i]<tempmax&&hai[i]>temp2nd&& i=! id[0])
{temp2nd=hai[i];id[1]=i;}
}
for(i=0;i<10;i++){
/* 3番目求める */
if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
{temp3rd=hai[i];}
}
/* 表示 */
printf("最も高い山の高さ %d\n",tempmax);
printf("2番目に高い山の高さ %d\n",temp2nd);
printf("3番目に高い山の高さ %d\n",temp3rd);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:28:42: error: lvalue required as left operand of assignment
28 | if(hai[i]<tempmax&&hai[i]>temp2nd&& i=! id[0])
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
a.cc:33:57: error: lvalue required as left operand of assignment
33 | if(hai[i]>temp3rd&&hai[i]<temp2nd && i =! id[1] && i =! id[0])
| ~~~~~~~~^~~~
|
s043038418
|
p00001
|
C++
|
#include<stdio.h>
int main(void){
/* 宣言と初期化 */
int hai[10];
int id[2];
int i;
int temp2nd;
int temp3rd;
int tempmax;
for(i=0;i<10;i++)
{
cin >> hai[i];
}
/* 代入 */
temp2nd=hai[0];
tempmax=hai[0];
temp3rd=hai[0];
/* 計算 */
for(i=0;i<10;i++){
/* 最大値求める */
if(hai[i]>tempmax)
{tempmax=hai[i];id[0]=i;}
}
for(i=0;i<10;i++){
/*2番目求める */
if(hai[i]<tempmax&&hai[i]>temp2nd&& i != id[0])
{temp2nd=hai[i];id[1]=i;}
}
for(i=0;i<10;i++){
/* 3番目求める */
if(hai[i]>temp3rd&&hai[i]<temp2nd && i != id[1] && i != id[0])
{temp3rd=hai[i];}
}
/* 表示 */
printf("最も高い山の高さ %d\n",tempmax);
printf("2番目に高い山の高さ %d\n",temp2nd);
printf("3番目に高い山の高さ %d\n",temp3rd);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:4: error: 'cin' was not declared in this scope
14 | cin >> hai[i];
| ^~~
|
s863060603
|
p00001
|
C++
|
#include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
int main(void){
/* 宣言と初期化 */
int hai[10];
int id[2];
int i;
int temp2nd;
int temp3rd;
int tempmax;
for(i=0;i<10;i++)
{
cin >> hai[i];
}
/* 代入 */
temp2nd=hai[0];
tempmax=hai[0];
temp3rd=hai[0];
/* 計算 */
for(int j=9;j>1;j--){
for(i=0;i<j;i++){
/* 最大値求める */
if(hai[j]<hai[i])
{tempmax=hai[i];
hai[i]=hai[j];
hai[j]=tempmax
}
}
}
/* 表示 */
printf("%d\n",hai[9]);
printf("%d\n",hai[8]);
printf("%d\n",hai[7]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:30:24: error: expected ';' before '}' token
30 | hai[j]=tempmax
| ^
| ;
31 | }
| ~
|
s545532684
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a[11],max1,max2,max3;
for (int i=0; i<10; i++){
while (true){
cout << "山の高さ" << i+1 << "(整数)" ;
cin >> a[i];
if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) {
break;
}
}
}
max1 = a[0];
for (i=1; i<10; i++){
if (max1 < a[i]){
swap (max1,a[i]);
}
}
max2 = a[1];
for (i=2; i<10; i++){
if (max2 < a[i]){
swap (max2,a[i]);
}
}
max3 = a[2];
for (i=3; i<10; i++){
if (max3 < a[i]){
swap (max3,a[i]);
}
}
cout << max1 << endl;
cout << max2 << endl;
cout << max3 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:22:14: error: 'i' was not declared in this scope
22 | for (i=1; i<10; i++){
| ^
a.cc:29:14: error: 'i' was not declared in this scope
29 | for (i=2; i<10; i++){
| ^
a.cc:36:14: error: 'i' was not declared in this scope
36 | for (i=3; i<10; i++){
| ^
|
s917792026
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a[11],max1,max2,max3;
for (int i=0; i<10; i++){
while (true){
cout << "山の高さ" << i+1 << "(整数)" ;
cin >> a[i];
if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) {
break;
}
}
}
max1 = a[0];
for (i=1; i<10; i++){
if (max1 < a[i]){
swap (max1,a[i]);
}
}
max2 = a[1];
for (i=2; i<10; i++){
if (max2 < a[i]){
swap (max2,a[i]);
}
}
max3 = a[2];
for (i=3; i<10; i++){
if (max3 < a[i]){
swap (max3,a[i]);
}
}
cout << max1 << endl;
cout << max2 << endl;
cout << max3 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:14: error: 'i' was not declared in this scope
20 | for (i=1; i<10; i++){
| ^
a.cc:27:14: error: 'i' was not declared in this scope
27 | for (i=2; i<10; i++){
| ^
a.cc:34:14: error: 'i' was not declared in this scope
34 | for (i=3; i<10; i++){
| ^
|
s373939841
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a[10],max1,max2,max3;
for (int i=0; i<10; i++){
while (true){
cout << "山の高さ" << i+1 << "(整数)" ;
cin >> a[i];
if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) {
break;
}
}
}
max1 = a[0];
for (i=1; i<10; i++){
if (max1 < a[i]){
swap (max1,a[i]);
}
}
max2 = a[1];
for (i=2; i<10; i++){
if (max2 < a[i]){
swap (max2,a[i]);
}
}
max3 = a[2];
for (i=3; i<10; i++){
if (max3 < a[i]){
swap (max3,a[i]);
}
}
cout << max1 << endl;
cout << max2 << endl;
cout << max3 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:14: error: 'i' was not declared in this scope
20 | for (i=1; i<10; i++){
| ^
a.cc:27:14: error: 'i' was not declared in this scope
27 | for (i=2; i<10; i++){
| ^
a.cc:34:14: error: 'i' was not declared in this scope
34 | for (i=3; i<10; i++){
| ^
|
s296845140
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a[11],max1,max2,max3;
for (int i=1; i<11; i++){
while (true){
cout << "山の高さ" << i << "(整数)" ;
cin >> a[i];
if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) {
break;
}
}
}
max1 = a[1];
for (i=2; i<11; i++){
if (max1 < a[i]){
swap (max1,a[i]);
}
}
max2 = a[2];
for (i=3; i<11; i++){
if (max2 < a[i]){
swap (max2,a[i]);
}
}
max3 = a[3];
for (i=4; i<11; i++){
if (max3 < a[i]){
swap (max3,a[i]);
}
}
cout << max1 << endl;
cout << max2 << endl;
cout << max3 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:14: error: 'i' was not declared in this scope
20 | for (i=2; i<11; i++){
| ^
a.cc:27:14: error: 'i' was not declared in this scope
27 | for (i=3; i<11; i++){
| ^
a.cc:34:14: error: 'i' was not declared in this scope
34 | for (i=4; i<11; i++){
| ^
|
s780586085
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a[11],max1,max2,max3;
for (int i=1; i<11; i++){
while (true){
cout << "山の高さ" << i << "(整数)" ;
cin >> a[i];
if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) { break; }}}
max1 = a[1];
for (i=2; i<11; i++){
if (max1 < a[i]){
swap (max1,a[i]);
}}
max2 = a[2];
for (i=3; i<11; i++){
if (max2 < a[i]){
swap (max2,a[i]);
}}
max3 = a[3];
for (i=4; i<11; i++){
if (max3 < a[i]){
swap (max3,a[i]);
}}
cout << max1 << endl;
cout << max2 << endl;
cout << max3 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:14: error: 'i' was not declared in this scope
11 | for (i=2; i<11; i++){
| ^
a.cc:16:14: error: 'i' was not declared in this scope
16 | for (i=3; i<11; i++){
| ^
a.cc:21:14: error: 'i' was not declared in this scope
21 | for (i=4; i<11; i++){
| ^
|
s717091295
|
p00001
|
C++
|
#include <iostream>
using namespace std;
void cswap(int &x, int &y)
{
int tmp = x;
x = y;
y = tmp;
}
int main(void){
int a[11],max1,max2,max3;
for (int i=1; i<11; i++){
while (true){
cout << "山の高さ" << i << "(整数)" ;
cin >> a[i];
if ((cin.good() == 1) && (a[i] >= 0) && (a[i] <= 10000)) {
break;
}
}
}
max1 = a[1];
for (i=2; i<11; i++){
if (max1 < a[i]){
cswap(max1,a[i]);
}
}
max2 = a[2];
for (i=3; i<11; i++){
if (max2 < a[i]){
cswap(max2,a[i]);
}
}
max3 = a[3];
for (i=4; i<11; i++){
if (max3 < a[i]){
cswap(max3,a[i]);
}
}
cout << max1 << endl;
cout << max2 << endl;
cout << max3 << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:27:14: error: 'i' was not declared in this scope
27 | for (i=2; i<11; i++){
| ^
a.cc:34:14: error: 'i' was not declared in this scope
34 | for (i=3; i<11; i++){
| ^
a.cc:41:14: error: 'i' was not declared in this scope
41 | for (i=4; i<11; i++){
| ^
|
s344391851
|
p00001
|
C++
|
#include <algorithm>
#include <deque>
#include <functional>
#include <iostream>
using namespace std;
int main(){
int hills[10];
for(int i=0;i<10;i++)cin >> hills[i];
partial_sort( hills, hills + 3, hills+10, greater<int>() );
for(int i=0;i<3;i++) cout << hills[i] <<endl;
return 0;
}
|
a.cc:15:25: error: extended character is not valid in an identifier
15 | for(int i=0;i<3;i++) cout << hills[i] <<endl;
| ^
a.cc: In function 'int main()':
a.cc:15:25: error: '\U00003000cout' was not declared in this scope
15 | for(int i=0;i<3;i++) cout << hills[i] <<endl;
| ^~~~~~
|
s030299654
|
p00001
|
C++
|
#include <iostream>
#include <string>
#include <stringstream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstdlib>
using namespace std;
#define REP(i,n) for(int i=0;i<n;++i)
#define rep(n) REP(i,n)
int main()
{
int hills[10];
rep(10) cin>>hills[i];
sort( hills, hills+9, greater<int>() );
rep(3) cout<<hills[i]<<endl;
return 0;
}
|
a.cc:3:10: fatal error: stringstream: No such file or directory
3 | #include <stringstream>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s543046845
|
p00001
|
C++
|
#include <iostream>
#include <string>
#include <stringstream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstdlib>
using namespace std;
#define REP(i,n) for(int i=0;i<n;++i)
#define rep(n) REP(i,n)
int hills[16];
int main()
{
rep(10) cin>>hills[i];
sort( hills, hills+10, greater<int>() );
rep(3) cout<<hills[i]<<endl;
return 0;
}
|
a.cc:3:10: fatal error: stringstream: No such file or directory
3 | #include <stringstream>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s743238837
|
p00001
|
C++
|
#include <iostream>
#include <set>
using namespace std;
int main(void){
int count = 0;
set<int, greater<int> > nums;
for (int i=0; i<10; ++i){
int num;
cin >> num;
nums.insert(num);
}
set<int, greater<int> >::iterator it = nums.begin();
while (it != nums.end() && (n<3)){
cout << *it << endl;
++it;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:37: error: 'n' was not declared in this scope
15 | while (it != nums.end() && (n<3)){
| ^
|
s597836763
|
p00001
|
C++
|
using namespace std;
int main(){
vector <int> v;
for(int i = 0;i < 10;i++){
int n;
cin >> n;
v.push_back(n);
}
sort(v.begin(), v.end());
//cout << endl;
for(int i = 9; i >=7;i--){
cout << v[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:4:9: error: 'vector' was not declared in this scope
4 | vector <int> v;
| ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
+++ |+#include <vector>
1 | using namespace std;
a.cc:4:17: error: expected primary-expression before 'int'
4 | vector <int> v;
| ^~~
a.cc:7:17: error: 'cin' was not declared in this scope
7 | cin >> n;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:8:17: error: 'v' was not declared in this scope
8 | v.push_back(n);
| ^
a.cc:10:14: error: 'v' was not declared in this scope
10 | sort(v.begin(), v.end());
| ^
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(v.begin(), v.end());
| ^~~~
| short
a.cc:13:17: error: 'cout' was not declared in this scope
13 | cout << v[i] << endl;
| ^~~~
a.cc:13:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:33: error: 'endl' was not declared in this scope
13 | cout << v[i] << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s471319523
|
p00001
|
C++
|
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int i, j, a[10];
for(i=0;i<10;i++){
scanf("%d", &a[i]);
}
sort(a,a+10);
for(j=0;j<3;j++){
printf("%d\n", a[9-j]);
}
}
|
a.cc: In function 'int main()':
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'?
11 | sort(a,a+10);
| ^~~~
| short
|
s898718342
|
p00001
|
C++
|
a
|
a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s442179380
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int a[10];
for(int i=0; i<10; i++){
cin>>a[i];
}
int T=0;
for(int j=1; j==0; j++;){
T=0;
for(int i=0; i<9; i++){
if(a[i]<a[i+1]){
int L;
L=a[i];
a[i]=a[i+1];
a[i+1]=L;
T=1;
}
}
if(T=0) break;
}
for(int i=0; i<3; i++){
cout<<a[i]<<"\n";
}
}
|
a.cc: In function 'int main()':
a.cc:12:31: error: expected ')' before ';' token
12 | for(int j=1; j==0; j++;){
| ~ ^
| )
a.cc:12:32: error: expected primary-expression before ')' token
12 | for(int j=1; j==0; j++;){
| ^
|
s341531713
|
p00001
|
C++
|
#include<iostream>
int main(){
int a[10];
for(int k=0;k<10;k++){
cin>>a[k]>>endl;
}
for(int i = 0; i < 10; i++){
for(int j = i + 1; j < 10; j++){
if(a[i] > a[j]){
dumy = a[i];
a[i] = a[j];
a[j] = dumy;
}
}
}
for(int k=0;k<10;k++){
cout<<a[0] <<a[1] <<a[2]<<endl;
}
return 0}
|
a.cc: In function 'int main()':
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin>>a[k]>>endl;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:9:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | cin>>a[k]>>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)
| ^~~~
a.cc:15:1: error: 'dumy' was not declared in this scope
15 | dumy = a[i];
| ^~~~
a.cc:25:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
25 | cout<<a[0] <<a[1] <<a[2]<<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:25:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
25 | cout<<a[0] <<a[1] <<a[2]<<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:30:9: error: expected ';' before '}' token
30 | return 0}
| ^
| ;
|
s758454255
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a[10];
for(int k=0;k<10;k++){
cin>>a[k]>>endl;
}
for(int i = 0; i < 10; i++){
for(int j = i + 1; j < 10; j++){
if(a[i] > a[j]){
dumy = a[i];
a[i] = a[j];
a[j] = dumy;
}
}
}
for(int k=0;k<10;k++){
cout<<a[0] <<a[1] <<a[2]<<endl;
}
return 0}
|
a.cc: In function 'int main()':
a.cc:10:10: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
10 | cin>>a[k]>>endl;
| ~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:42,
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);
| ~~~~~~~~
|
s512396614
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a[10];
for(int k=0;k<10;k++){
cin>>a[k]>>endl;
}
for(int i = 0; i < 10; i++){
for(int j = i + 1; j < 10; j++){
if(a[i] > a[j]){
dumy = a[i];
a[i] = a[j];
a[j] = dumy;
}
}
}
for(int k=0;k<10;k++){
cout<<a[0] <<a[1] <<a[2]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:10: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
10 | cin>>a[k]>>endl;
| ~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:42,
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);
| ~~~~~~~~
|
s805107827
|
p00001
|
C++
|
arr = []
for cnt in 0...10
arr.push(gets.chomp.to_i())
end
arr.sort!.reverse!
for cnt in 0...3
puts(arr[cnt])
end
|
a.cc:2:12: error: too many decimal points in number
2 | for cnt in 0...10
| ^~~~~~
a.cc:8:12: error: too many decimal points in number
8 | for cnt in 0...3
| ^~~~~
a.cc:1:1: error: 'arr' does not name a type
1 | arr = []
| ^~~
|
s430241546
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int i=0;
int m[10];
for(i=0;i<10;i++)
{
cin>>m[i];
while(0>m[i]||m[i]>10000)
cin>>m[i];
}
sort(m[0], m[9], greater<int>());
cout<<m[0]<<endl<<m[1]<<endl<<m[2]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
15 | sort(m[0], m[9], greater<int>());
| ^~~~
| short
|
s921087573
|
p00001
|
C++
|
#include<iostream>
#include <algorithm>
#include <functional>
using namespace std;
int main(){
int i=0;
int m[10];
for(i=0;i<10;i++)
{
cin>>m[i];
while(0>m[i]||m[i]>10000)
cin>>m[i];
}
sort(m[0], m[9], greater<int>());
cout<<m[0]<<endl<<m[1]<<endl<<m[2]<<endl;
return 0;
}
|
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]':
/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_comp_iter<greater<int> >]'
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_comp_iter<greater<int> >]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int; _Compare = greater<int>]'
4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:17:7: required from here
17 | sort(m[0], m[9], greater<int>());
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = int; _Iterator2 = int; _Compare = std::greater<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_comp_iter<greater<int> >]'
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_comp_iter<greater<int> >]'
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_comp_iter<greater<int> >]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int; _Compare = greater<int>]'
4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:17:7: required from here
17 | sort(m[0], m[9], greater<int>());
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:31: error: invalid type argument of unary '*' (have 'int')
158 | { return bool(_M_comp(*__it1, *__it2)); }
| ^~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:39: error: invalid type argument of unary '*' (have 'int')
158 | { return bool(_M_comp(*__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_comp_iter<greater<int> >]':
/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_comp_iter<greater<int> >]'
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_comp_iter<greater<int> >]'
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_comp_iter<greater<int> >]'
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_comp_iter<greater<int> >]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int; _Compare = greater<int>]'
4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:17:7: required from here
17 | sort(m[0], m[9], greater<int>());
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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_comp_iter<greater<int> >]':
/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_comp_iter<greater<int> >]'
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_comp_iter<greater<int> >]'
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_comp_iter<greater<int> >]'
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_comp_iter<greater<int> >]'
1905 | std::__introsort_loop(__first, __last,
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
1906 | std::__lg(__last - __first) * 2,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1907 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int; _Compare = greater<int>]'
4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s398500015
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
int mountain[10];
for( int i = 0 ; i < 10 ; i++ ){
cin >> mountain[i];
}
sort( mountain , mountain + 10 );
cout << mountain[9] << endl << mountain[8] << endl; <<mountain[7] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:55: error: expected primary-expression before '<<' token
16 | cout << mountain[9] << endl << mountain[8] << endl; <<mountain[7] << endl;
| ^~
|
s546721620
|
p00001
|
C++
|
#include <iostream>
int main()
{
int best[] = {0, 0, 0};
int t;
for(int i = 0; i < 10; ++i)
{
std::cin << t << std::endl;
for(int j = 0; j < 3; ++j)
{
if(t > best[j])
{
for(int k = 3; k > j; --k)
best[k] = best[k - 1];
best[j] = t;
}
}
for(int i = 0; i < 3; ++i)
std::cout << best[j] << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:14: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
9 | std::cin << t << std::endl;
| ~~~~~~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:9:14: note: candidate: 'operator<<(int, int)' (built-in)
9 | std::cin << t << std::endl;
| ~~~~~~~~~^~~~
a.cc:9:14: 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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | std::cin << t << std::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: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:9:10: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
9 | std::cin << t << std::endl;
| ~~~~~^~~
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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | std::cin << t << std::endl;
| ^
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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | std::cin << t << std::endl;
| ^
/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:9:17: required from here
9 | std::cin << t << std::endl;
| ^
/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:20:25: error: 'j' was not declared in this scope
20 | std::cout << best[j] << std::endl;
| ^
|
s178131506
|
p00001
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main(){
int a=0;
std::vector<int> vec(10);
for(int i=0;i<10;i++){
std::cin>>vec[i];
}
/*for(int d=0;d<3;d++){
for(int i=0;i<10;i++){
if(vec[i]>a)a=vec[i];
}
std::cout<<a<<std::endl;
for(int i=0;i<10;i++){
if(vec[i]==a)vec[i]=0;
}
a=0;
}*/
for(int i=0;i<9;i++){
if(vec[i]<vec[i+1]){
a=vec[i];
vec[i]=vec[i+1];
vec[i+1]=a;
a=0;
}
}
std::cout<<vec[0]<<std::endl<<vec[1]<<std::endl<<vec[2]<<std::endl;
return 0;
|
a.cc: In function 'int main()':
a.cc:29:18: error: expected '}' at end of input
29 | return 0;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s920248792
|
p00001
|
C++
|
#include<cstdio>
#include<cstring>
int main(){
int n[10],a;
for (int f=0;f<10;f++){
scanf("%d",&n[f]);
}
for(int f1=0;f1<10;f1++){
for(int f2=0;f2<10;f2++){
a=max(a,max(n[f1],n[f2]));
}
}
printf("%d",a);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:21: error: 'max' was not declared in this scope
11 | a=max(a,max(n[f1],n[f2]));
| ^~~
a.cc:11:15: error: 'max' was not declared in this scope
11 | a=max(a,max(n[f1],n[f2]));
| ^~~
|
s946319921
|
p00001
|
C++
|
#include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; }
|
a.cc:1:19: warning: extra tokens at end of #include directive
1 | #include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s524170965
|
p00001
|
C++
|
#include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; }
|
a.cc:1:19: warning: extra tokens at end of #include directive
1 | #include <cstdio> #include <algorithm> using namespace std; int main(void){ int a[10]; int i; for(i=0;i<10;i++){ scanf("%d",&(a[i])); } sort(a,a+10); for(i=9;i>6;i--){ printf("%d\n",a[i]); } return 0; }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s186715452
|
p00001
|
C++
|
include <iostream>
int main(){
int first=0,second=0,third=0,height;
for(int i=0;i<10;++i){
height=get();
if(height>first){
second=first;
first=height;
}
else if(height>second){
third=second;
second=height;
}
else if(height>third){
third=height;
}
}
std::cout<<first<<'\n'<<second<<'\n'<<third<<'\n';
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
|
s150478444
|
p00001
|
C++
|
#include <iostream>
int main(){
int first=0,second=0,third=0,height;
for(int i=0;i<10;++i){
height=get();
if(height>first){
second=first;
first=height;
}
else if(height>second){
third=second;
second=height;
}
else if(height>third){
third=height;
}
}
std::cout<<first<<'\n'<<second<<'\n'<<third<<'\n';
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:24: error: 'get' was not declared in this scope; did you mean 'std::get'?
6 | height=get();
| ^~~
| std::get
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68,
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/tuple:2517:5: note: 'std::get' declared here
2517 | get(const tuple<_Types...>&& __t) noexcept
| ^~~
|
s484988320
|
p00001
|
C++
|
#include <iostream>
int main(){
int first=0,second=0,third=0,height;
for(int i=0;i<10;++i){
cin>>height;
if(height>first){
second=first;
first=height;
}
else if(height>second){
third=second;
second=height;
}
else if(height>third){
third=height;
}
}
std::cout<<first<<'\n'<<second<<'\n'<<third<<'\n';
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>>height;
| ^~~
| 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
| ^~~
|
s842584499
|
p00001
|
C++
|
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> height;
int h;
while (cin>>h) {
height.push_back(h);
}
sort(height.begin(), height.end());
for(int i=1;i<=3;i++){
cout<<height[height.size()-i]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(height.begin(), height.end());
| ^~~~
| short
|
s794709921
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
vector <int> v;
int a;
for(int i-;i<10;i++){
cin >> a;
v.push_back(a);
}
sort(v.begin(),v.end);
cout << v[0] << endl << v[1] << endl << v[2] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:10: error: expected ';' before '-' token
9 | for(int i-;i<10;i++){
| ^
| ;
a.cc:9:11: error: expected primary-expression before ';' token
9 | for(int i-;i<10;i++){
| ^
a.cc:9:16: error: expected ')' before ';' token
9 | for(int i-;i<10;i++){
| ~ ^
| )
a.cc:9:17: error: 'i' was not declared in this scope
9 | for(int i-;i<10;i++){
| ^
a.cc:14:5: error: no matching function for call to 'sort(std::vector<int>::iterator, <unresolved overloaded function type>)'
14 | sort(v.begin(),v.end);
| ~~~~^~~~~~~~~~~~~~~~~
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: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:63: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/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
|
s032178846
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
vector <int> v;
int a;
for(int i-;i<10;i++){
cin >> a;
v.push_back(a);
}
sort(v.begin(),v.end());
cout << v[0] << endl << v[1] << endl << v[2] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:14: error: expected ';' before '-' token
9 | for(int i-;i<10;i++){
| ^
| ;
a.cc:9:15: error: expected primary-expression before ';' token
9 | for(int i-;i<10;i++){
| ^
a.cc:9:20: error: expected ')' before ';' token
9 | for(int i-;i<10;i++){
| ~ ^
| )
a.cc:9:21: error: 'i' was not declared in this scope
9 | for(int i-;i<10;i++){
| ^
|
s824139085
|
p00001
|
C++
|
//#pragma comment(linker,"/STACK:102400000,102400000")
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<cmath>
#define M 40000
using namespace std;
typedef struct yyyy
{
int h;
double s[5],t[5];
}yyy;
double h;
double l[3],r[3];
const double pi=acos(-1);
double a[205];
yyy p[3][205];
double eps=1e-6;
int n;
typedef struct nnode
{
double tt;
int flag;
}node;
node as[200000];
int tim;
void cjj(int n)
{
int i,j;
for (i=1;i<=n;i++)
for (j=1;j<=2;j++)
{
double k1,k2;
double a1,a2;
double si,co;
double ll,h;
double v=a[i];
double k=v*sqrt(v*v+2*9.8*h)/9.8;
int flag;
k1=l[j]/k;
k2=r[j]/k;
if (k1>1+eps) {p[j][i].h=0;continue;}
si=l[j]/k;
co=sqrt(1-si*si);
ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
h=l[j]*9.8/ll;
if (ll<sqrt(2*9.8*h)+eps) flag=-1;
else flag=1;
a1=acos(h/v)*flag;
co=-sqrt(1-si*si);
ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
h=l[j]*9.8/ll;
if (ll<sqrt(2*9.8*h)+eps) flag=-1;
else flag=1;
a2=acos(h/v)*flag;
if (a1<a2) swap(a1,a2);
if (k2>1-eps) {p[j][i].h=1;p[j][i].s[1]=a1;p[j][i].t[1]=a2;continue;}
else
{
p[j][i].h=2;
p[j][i].s[1]=a1;
p[j][i].t[2]=a2;
}
si=r[j]/k;
co=sqrt(1-si*si);
ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
h=r[j]*9.8/ll;
if (ll<sqrt(2*9.8*h)+eps) flag=-1;
else flag=1;
a1=acos(h/v)*flag;
co=-sqrt(1-si*si);
ll=sqrt(2*v*v+2*9.8*h-2*v*sqrt(v*v+2*9.8*h)*co);
h=r[j]*9.8/ll;
if (ll<sqrt(2*9.8*h)+eps) flag=-1;
else flag=1;
a2=acos(h/v)*flag;
if (a1<a2) swap(a1,a2);
p[j][i].s[2]=a2;
p[j][i].t[1]=a1;
}
}
int main()
{
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int k,kk;
int i;
while(~scanf("%d",&n))
{
int c,maxx=0;
if(n==0)break;
scanf("%lf%lf%lf%lf%lf",&h,&l[1],&r[1],&l[2],&r[2]);
for(i=1;i<=n;i++)
scanf("%lf",&a[i]);
cjj(n);
tim=0;
for(i=1;i<=n;i++)
{
a[++tim].tt
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:123:26: error: request for member 'tt' in 'a[(++ tim)]', which is of non-class type 'double'
123 | a[++tim].tt
| ^~
|
s081527881
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main() {
int a[10];
int b;
for(int i=0;i<10;i++){
cin>>b;
a[i]=b;
}
sort(a,a+10,greater<int>());
cout<<a[0]<<endl;
cout<<a[1]<<endl;
cout<<a[2]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:1: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(a,a+10,greater<int>());
| ^~~~
| short
|
s266685428
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main() {
int a[10];
int b;
for(int i=0;i<10;i++){
cin>>b;
a[i]=b;
}
sort(a,a+10,greater<int>());
cout<<a[0]<<endl;
cout<<a[1]<<endl;
cout<<a[2]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:1: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(a,a+10,greater<int>());
| ^~~~
| short
|
s140306954
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main() {
int a[10];
int b;
for(int i=0;i<10;i++){
cin>>b;
a[i]=b;
}
sort(a,a+10,greater<int>());
cout<<a[0]<<endl;
cout<<a[1]<<endl;
cout<<a[2]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:1: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(a,a+10,greater<int>());
| ^~~~
| short
|
s453955092
|
p00001
|
C++
|
#include<stdio.h>
int main()
{
long long int ansh[11],i,n,a=0,b=0,c=0;
for(i=1;i<=10;i++){
scanf("%lld",&ansh[i]);
if(a<=ansh[i]){
c=b;
y=a;
a=ansh[i];
}
else if(b<=ansh[i]){
c=b;
y=ansh[i];
}
else if(z<=ansh[i]){
c=ansh[i];
}
}
printf("%lld\n%lld\n%lld\n",a,b,c);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:13: error: 'y' was not declared in this scope
9 | y=a;
| ^
a.cc:14:13: error: 'y' was not declared in this scope
14 | y=ansh[i];
| ^
a.cc:16:17: error: 'z' was not declared in this scope
16 | else if(z<=ansh[i]){
| ^
|
s013237562
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int a[3],n;
int main(){
a[0] = 0;
a[1] = 0;
a[2] = 0;
for(int i = 0; i < 10; i++){
cin >> n;
if(a[2] > n){
break;
}else{
if(a[1] > n){
a[2] = n;
}else{
if(a[0] > n){
a[2] = a[1];
a[1] = n;
}else{
a[2] = a[1];
a[1] = a[0];
a[0] = n;
}
}
}
}
cout << a[0] << endl << a[1] << andl << a[2] << endl
}
|
a.cc: In function 'int main()':
a.cc:29:35: error: 'andl' was not declared in this scope
29 | cout << a[0] << endl << a[1] << andl << a[2] << endl
| ^~~~
|
s870137341
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int a[3],n;
int main(){
a[0] = 0;
a[1] = 0;
a[2] = 0;
for(int i = 0; i < 10; i++){
cin >> n;
if(a[2] > n){
break;
}else{
if(a[1] > n){
a[2] = n;
}else{
if(a[0] > n){
a[2] = a[1];
a[1] = n;
}else{
a[2] = a[1];
a[1] = a[0];
a[0] = n;
}
}
}
}
cout << a[0] << endl << a[1] << andl << a[2] << endl;
}
|
a.cc: In function 'int main()':
a.cc:29:35: error: 'andl' was not declared in this scope
29 | cout << a[0] << endl << a[1] << andl << a[2] << endl;
| ^~~~
|
s787326006
|
p00001
|
C++
|
#include <stdio.h>
const int tall[10] = {
1819,
2003,
876,
2840,
1723,
1673,
3776,
2848,
1592,
922
};
int main(void)
{
int sort[3] = {0, 0, 0};
int i;
int temp;
for(i = 0; i < 10; i++){
if(tall[i] > sort[0]){
sort[2] = sort[1];
sort[1] = sort[0];
sort[0] = tall[i];
}
else if(tall[i] > sort[1]){
sort[2] = sort[1];
sort[1] = tall[i];
}
else if(tall[i] > sort[2]){
sort[2] = tall[i];
}
}
printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
return 0;
}
|
a.cc:36:18: error: stray '\' in program
36 | printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
| ^
a.cc:36:22: error: stray '\' in program
36 | printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
| ^
a.cc: In function 'int main()':
a.cc:36:16: error: expected primary-expression before '%' token
36 | printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
| ^
a.cc:36:17: error: 'd' was not declared in this scope
36 | printf(%d\n%d\n%d, sort[0], sort[1], sort[2]);
| ^
|
s957905319
|
p00001
|
C++
|
#include <stdio.h>
int main(void)
{
int sort[3] = {0, 0, 0};
int i;
int temp;
for(i = 0; i < 10; i++){
scanf("%d", &temp);
if(tall[i] > sort[0]){
sort[2] = sort[1];
sort[1] = sort[0];
sort[0] = tall[i];
}
else if(tall[i] > sort[1]){
sort[2] = sort[1];
sort[1] = tall[i];
}
else if(tall[i] > sort[2]){
sort[2] = tall[i];
}
}
printf("%d\n%d\n%d\n", sort[0], sort[1], sort[2]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:20: error: 'tall' was not declared in this scope
11 | if(tall[i] > sort[0]){
| ^~~~
|
s502954765
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main() {
   int height[10];
   int tmp;
   int i=0,j=0;
   for (;i<10;i++)
      cin>>height[i];
   for (i=0;i<100;i++)
      for(j=1;j<10;j++)
         if (height[j-1]<height[j]) {
            tmp = height[j-1];
            height[j-1] = height[j];
            height[j] = tmp;
         }
   for (i=0;i<3;i++)
      cout<<height[i]<<endl;
   return 0;
}
|
a.cc:5:2: error: stray '#' in program
5 |    int height[10];
| ^
a.cc:5:9: error: stray '#' in program
5 |    int height[10];
| ^
a.cc:5:16: error: stray '#' in program
5 |    int height[10];
| ^
a.cc:6:2: error: stray '#' in program
6 |    int tmp;
| ^
a.cc:6:9: error: stray '#' in program
6 |    int tmp;
| ^
a.cc:6:16: error: stray '#' in program
6 |    int tmp;
| ^
a.cc:7:2: error: stray '#' in program
7 |    int i=0,j=0;
| ^
a.cc:7:9: error: stray '#' in program
7 |    int i=0,j=0;
| ^
a.cc:7:16: error: stray '#' in program
7 |    int i=0,j=0;
| ^
a.cc:9:2: error: stray '#' in program
9 |    for (;i<10;i++)
| ^
a.cc:9:9: error: stray '#' in program
9 |    for (;i<10;i++)
| ^
a.cc:9:16: error: stray '#' in program
9 |    for (;i<10;i++)
| ^
a.cc:10:2: error: stray '#' in program
10 |       cin>>height[i];
| ^
a.cc:10:9: error: stray '#' in program
10 |       cin>>height[i];
| ^
a.cc:10:16: error: stray '#' in program
10 |       cin>>height[i];
| ^
a.cc:10:23: error: stray '#' in program
10 |       cin>>height[i];
| ^
a.cc:10:30: error: stray '#' in program
10 |       cin>>height[i];
| ^
a.cc:10:37: error: stray '#' in program
10 |       cin>>height[i];
| ^
a.cc:11:2: error: stray '#' in program
11 |    for (i=0;i<100;i++)
| ^
a.cc:11:9: error: stray '#' in program
11 |    for (i=0;i<100;i++)
| ^
a.cc:11:16: error: stray '#' in program
11 |    for (i=0;i<100;i++)
| ^
a.cc:12:2: error: stray '#' in program
12 |       for(j=1;j<10;j++)
| ^
a.cc:12:9: error: stray '#' in program
12 |       for(j=1;j<10;j++)
| ^
a.cc:12:16: error: stray '#' in program
12 |       for(j=1;j<10;j++)
| ^
a.cc:12:23: error: stray '#' in program
12 |       for(j=1;j<10;j++)
| ^
a.cc:12:30: error: stray '#' in program
12 |       for(j=1;j<10;j++)
| ^
a.cc:12:37: error: stray '#' in program
12 |       for(j=1;j<10;j++)
| ^
a.cc:13:2: error: stray '#' in program
13 |          if (height[j-1]<height[j]) {
| ^
a.cc:13:9: error: stray '#' in program
13 |          if (height[j-1]<height[j]) {
| ^
a.cc:13:16: error: stray '#' in program
13 |          if (height[j-1]<height[j]) {
| ^
a.cc:13:23: error: stray '#' in program
13 |          if (height[j-1]<height[j]) {
| ^
a.cc:13:30: error: stray '#' in program
13 |          if (height[j-1]<height[j]) {
| ^
a.cc:13:37: error: stray '#' in program
13 |          if (height[j-1]<height[j]) {
| ^
a.cc:13:44: error: stray '#' in program
13 |          if (height[j-1]<height[j]) {
| ^
a.cc:13:51: error: stray '#' in program
13 |          if (height[j-1]<height[j]) {
| ^
a.cc:13:58: error: stray '#' in program
13 |          if (height[j-1]<height[j]) {
| ^
a.cc:14:2: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:9: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:16: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:23: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:30: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:37: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:44: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:51: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:58: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:65: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:72: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:14:79: error: stray '#' in program
14 |             tmp = height[j-1];
| ^
a.cc:15:2: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:9: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:16: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:23: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:30: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:37: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:44: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:51: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:58: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:65: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:72: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:15:79: error: stray '#' in program
15 |             height[j-1] = height[j];
| ^
a.cc:16:2: error: stray '#' in program
16 |             height[j] = tmp;
| ^
a.cc:16:9: error: stray '#' in program
16 |             height[j] = tmp;
| ^
a.cc:16:16: error: stray '#' in program
16 |             height[j] = tmp;
| ^
a.cc:16:23: error: stray '#' in program
16 |            &
|
s607501558
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a[] = {1819
,2003
,876
,2840
,1723
,1673
,3776
,2848
,1592
,922};
int ma=0, aa = 0;
for(int j=0;j<3;j++){
for(int i=0;i<10;i++){
if(ma > a[i])
ma = a[i];
aa = i;
}
cout << ma << endl;
a[a] = 0;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:23:2: error: invalid types 'int [10][int [10]]' for array subscript
23 | a[a] = 0;
| ^
|
s112851193
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a[10] = {1819,2003,876,2840,1723,1673,3776,2848,1592,922};
int ma=0, aa = 0;
for(int j=0;j<3;j++){
for(int i=0;i<10;i++){
if(ma > a[i]){
ma = a[i];
aa = i;
}
}
cout << ma << endl;
a[a] = 0;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:2: error: invalid types 'int [10][int [10]]' for array subscript
16 | a[a] = 0;
| ^
|
s037745983
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
int n[10];
for(int i=0;i<10;i++)
cin >> n[i];
int a,b=0;
for(int j=0;j<3;j++){
for(i=0;i<10;i++){
if(b<n[i]){
b = n[i];
a = i;
}
}
cout << b;
n[a] = 0;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:5: error: 'i' was not declared in this scope
10 | for(i=0;i<10;i++){
| ^
|
s488853417
|
p00001
|
C++
|
int main(){
int a[10];
int max = 0;
int max2 = 0;
int max3 = 0;
int i;
int tmp;
for(i = 0; i < 10; i++){
std::cin >> a[i];
}
for(i = 0; i< 10; i++){
if(max < a[i]){
max = a[i];
tmp = i;
}
}
int tmp2;
for(int i = 0; i< 10; i++){
if(max2 < a[i] && tmp != i){
max2 = a[i];
tmp2 = i;
}
}
for(i = 0; i< 10; i++){
if(max3 < a[i]&& tmp != i&& tmp2 != i) max3 = a[i];
}
std::cout << max<< std::endl;
std::cout << max2<< std::endl;
std::cout << max3<< std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:6: error: 'cin' is not a member of 'std'
10 | std::cin >> a[i];
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | int main(){
a.cc:33:6: error: 'cout' is not a member of 'std'
33 | std::cout << max<< std::endl;
| ^~~~
a.cc:33:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:25: error: 'endl' is not a member of 'std'
33 | std::cout << max<< std::endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | int main(){
a.cc:34:6: error: 'cout' is not a member of 'std'
34 | std::cout << max2<< std::endl;
| ^~~~
a.cc:34:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:26: error: 'endl' is not a member of 'std'
34 | std::cout << max2<< std::endl;
| ^~~~
a.cc:34:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:35:6: error: 'cout' is not a member of 'std'
35 | std::cout << max3<< std::endl;
| ^~~~
a.cc:35:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:26: error: 'endl' is not a member of 'std'
35 | std::cout << max3<< std::endl;
| ^~~~
a.cc:35:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s092665369
|
p00001
|
C++
|
int main(){
int a[10];
int max = 0;
int max2 = 0;
int max3 = 0;
int i;
int tmp;
for(i = 0; i < 10; i++){
std::cin >> a[i];
}
for(i = 0; i< 10; i++){
if(max < a[i]){
max = a[i];
tmp = i;
}
}
int tmp2;
for(int i = 0; i< 10; i++){
if(max2 < a[i] && tmp != i){
max2 = a[i];
tmp2 = i;
}
}
for(i = 0; i< 10; i++){
if(max3 < a[i]&& tmp != i&& tmp2 != i) max3 = a[i];
}
std::cout << max<< std::endl;
std::cout << max2<< std::endl;
std::cout << max3<< std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:6: error: 'cin' is not a member of 'std'
10 | std::cin >> a[i];
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | int main(){
a.cc:33:6: error: 'cout' is not a member of 'std'
33 | std::cout << max<< std::endl;
| ^~~~
a.cc:33:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:25: error: 'endl' is not a member of 'std'
33 | std::cout << max<< std::endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | int main(){
a.cc:34:6: error: 'cout' is not a member of 'std'
34 | std::cout << max2<< std::endl;
| ^~~~
a.cc:34:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:26: error: 'endl' is not a member of 'std'
34 | std::cout << max2<< std::endl;
| ^~~~
a.cc:34:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:35:6: error: 'cout' is not a member of 'std'
35 | std::cout << max3<< std::endl;
| ^~~~
a.cc:35:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:26: error: 'endl' is not a member of 'std'
35 | std::cout << max3<< std::endl;
| ^~~~
a.cc:35:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s540909068
|
p00001
|
C++
|
#include <istream>
#include <fstream>
#define SIZE 10
#define TOPNUM 3
using namespace std;
int main(){
ifstream ifs("data.txt");
if( !ifs ) return 1;
int height[SIZE],top[TOPNUM+1]={0};
for( int i=0;i<SIZE;i++ ){
ifs>>height[i];
if( height[i]<0||10000<height[i] )
return 1;
for( int j=0;j<TOPNUM;j++ ){
if( height[i]>top[j] ){
for( int k=TOPNUM;k>j;k-- ){
top[k]=top[k-1];
}
top[j]=height[i];
break;
}
}
}
for( int i=0;i<TOPNUM;i++ ){
cout<<top[i]<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:26:17: error: 'cout' was not declared in this scope
26 | cout<<top[i]<<endl;
| ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <fstream>
+++ |+#include <iostream>
3 | #define SIZE 10
|
s134103475
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
int main(){
std::vector<int> o;
for(int i=1;i<=10;i++)int in=0,o.push_back(in);
std::sort(o.begin(),o.end());
std::cout<<o[7]<<std::endl<<o[8]<<std::endl<<o[9]<<std::endl;
}
|
a.cc: In function 'int main()':
a.cc:7:41: error: expected initializer before '.' token
7 | for(int i=1;i<=10;i++)int in=0,o.push_back(in);
| ^
|
s884500836
|
p00001
|
C++
|
#include <iostream>
using namespace std;
#define N 10
int max(int x[], int n)
{
int i,j;
j=0;
for(i=1; i<n; i++)
if(x[i]<x[j]) j=i;
return j;
}
void sel_sort(int x[], int n)
{
int i, j;
for(i=n; i>1; i--)
{ j=max(x,i); int temp=x[j]; x[j]=x[i-1]; x[i-1]=temp; }
}
void main()
{
int a[N], i;
while(cin>>a[0])
{
for(i=1; i<N; i++)
cin>>a[i];
sel_sort(a, N);
for(i=0; i<3; i++)
cout<<a[i]<<endl;
}
}
|
a.cc:18:1: error: '::main' must return 'int'
18 | void main()
| ^~~~
|
s564012088
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int max(int x[], 10)
{
int i,j;
j=0;
for(i=1; i<n; i++)
if(x[i]<x[j]) j=i;
return j;
}
void sel_sort(int x[], 10)
{
int i, j;
for(i=10; i>1; i--)
{ j=max(x,i); int temp=x[j]; x[j]=x[i-1]; x[i-1]=temp; }
}
void main()
{
int a[10], i;
while(cin>>a[0])
{
for(i=1; i<10; i++)
cin>>a[i];
sel_sort(a, 10);
for(i=0; i<3; i++)
cout<<a[i]<<endl;
}
}
|
a.cc:3:18: error: expected identifier before numeric constant
3 | int max(int x[], 10)
| ^~
a.cc:3:18: error: expected ',' or '...' before numeric constant
a.cc: In function 'int max(int*, int)':
a.cc:7:20: error: 'n' was not declared in this scope
7 | for(i=1; i<n; i++)
| ^
a.cc: At global scope:
a.cc:11:24: error: expected identifier before numeric constant
11 | void sel_sort(int x[], 10)
| ^~
a.cc:11:24: error: expected ',' or '...' before numeric constant
a.cc:17:1: error: '::main' must return 'int'
17 | void main()
| ^~~~
|
s792095908
|
p00001
|
C++
|
#include <iostream>
#include <conio.h>
using namespace std ;
int hills[10] ;
int tops[3] = {0,0,0} ;
int main()
{
for( int i = 0 ; i < 10 ; i ++ )
{
cin >> hills[i] ;
if( hills[i] >= tops[0] )
{
tops[2] = tops[1] ;
tops[1] = tops[0] ;
tops[0] = hills[i] ;
}
else if( hills[i] >= tops[1] )
{
tops[2] = tops[1] ;
tops[1] = hills[i] ;
}
else if( hills[i] >= tops[2] )
{
tops[2] = hills[i] ;
}
}
for( int i = 0 ; i < 3 ; i ++ )
{
cout << tops[i] << "\n" ;
}
_getch() ;
return 0 ;
}
|
a.cc:2:10: fatal error: conio.h: No such file or directory
2 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s621059904
|
p00001
|
C++
|
a = Array.new
10.times do
n = gets.to_i
a.push n
end
a.sort!
puts "#{a[9]} #{a[8]} #{a[7]}"
|
a.cc:1:1: error: 'a' does not name a type
1 | a = Array.new
| ^
|
s485796987
|
p00001
|
C++
|
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> heights;
for (int i = 0; i < 10; i++) {
int height;
cin >> height;
heights.push_back(height);
}
sort(heights.rbegin(), heights.rend());
for (int i = 0; i < 3; i++) {
cout << heights[i] << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(heights.rbegin(), heights.rend());
| ^~~~
| short
|
s522227461
|
p00001
|
C++
|
#include<iostream>
#include<queue>
using namespace std;
int main()
{
priority_queue<int> que;
for(int i=0;i<10;i++)
{
int t;
cin>>t;
que.push_pack(t);
}
for(int i=0;i<3;i++)
{
cout<<que.top()<<endl;
que.pop();
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:5: error: 'class std::priority_queue<int>' has no member named 'push_pack'
12 | que.push_pack(t);
| ^~~~~~~~~
|
s242391231
|
p00001
|
C++
|
#include<iostream>
#include<queue>
using namespace std;
int main()
{
priority_queue<int> que;
for(int i=0;i<10;i++)
{
int t;
cin>>t;
que.push_back(t);
}
for(int i=0;i<3;i++)
{
cout<<que.top()<<endl;
que.pop();
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:5: error: 'class std::priority_queue<int>' has no member named 'push_back'
12 | que.push_back(t);
| ^~~~~~~~~
|
s634238975
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
vector<int> a ;
int x;
for(int i=0;i<10;i++){
cin >> x
a.push_back(x);
}
sort(a.begin() ,a.end(),greater<int>);
for(int i=0;i<3;i++){
cout << a[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:13: error: expected ';' before 'a'
10 | cin >> x
| ^
| ;
11 | a.push_back(x);
| ~
a.cc:13:39: error: expected primary-expression before ')' token
13 | sort(a.begin() ,a.end(),greater<int>);
| ^
|
s260018143
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
vector<int> a;
int x;
for(int i=0;i<10;i++){
cin >> x
a.push_back(x);
}
sort(a.begin() ,a.end(),greater<int>());
for(int i=0;i<3;i++){
cout << a[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:13: error: expected ';' before 'a'
10 | cin >> x
| ^
| ;
11 | a.push_back(x);
| ~
|
s657034753
|
p00001
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main_test()
{
string str;
cout << "あなたの名前を入力してください" << endl;
cin >> str;
cout << str <<"さんよろ"<<endl;
return 0;
}
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s501799232
|
p00001
|
C++
|
#include<stdio.h>#include<algorithm>int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
|
a.cc:1:18: warning: extra tokens at end of #include directive
1 | #include<stdio.h>#include<algorithm>int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s410614513
|
p00001
|
C++
|
#include<stdio.h> #include<algorithm>int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
|
a.cc:1:19: warning: extra tokens at end of #include directive
1 | #include<stdio.h> #include<algorithm>int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s787341194
|
p00001
|
C++
|
#include<stdio.h> #include<algorithm> int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
|
a.cc:1:19: warning: extra tokens at end of #include directive
1 | #include<stdio.h> #include<algorithm> int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s323463710
|
p00001
|
C++
|
#include<stdio.h> #include<algorithm> using namespace std; int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
|
a.cc:1:19: warning: extra tokens at end of #include directive
1 | #include<stdio.h> #include<algorithm> using namespace std; int main(){int a[10];for(int i = 0; i < 10; i++)scanf("%d", &a[i]);std::sort(a);for(int i = 0; i < 3; i++)printf("%d\n", a[i]);return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s882564781
|
p00001
|
C++
|
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int a[10];
for(int i=0;i<10;i++)
scanf("%d", &a[i]);
sort(a[0],a[1]);
for(int i=0;i<3;i++)
printf("%d\n",a[i]);
return 0;
}
|
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/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:8:7: required from here
8 | sort(a[0],a[1]);
| ~~~~^~~~~~~~~~~
/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/stl_pair.h:61,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60:
/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:
/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:8:7: required from here
8 | sort(a[0],a[1]);
| ~~~~^~~~~~~~~~~
/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:8:7: required from here
8 | sort(a[0],a[1]);
| ~~~~^~~~~~~~~~~
/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:8:7: required from here
8 | sort(a[0],a[1]);
| ~~~~^~~~~~~~~~~
/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);
| ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:263:7: error: invalid type argument of unary '*' (have 'int')
263 | *__result = _GLIBCXX_MOVE(*__first);
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:263:19: error: invalid type argument of unary '*' (have 'int')
263 | *__result = _GLIBCXX_MOVE(*__first);
|
|
s970503755
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int a[10];
for(int i = 0; i < 10; i++)
scanf("%d" &a[i]);
for(int i = 0; i < 9; i++){
for(int j = i + 1; i < 10; i++){
if(a[i] > a[j])
swap(a[i], a[j]);
}
}
for(int i = 0; i < 3; i++){
printf("%d\n", a[i]);
}
}
|
a.cc: In function 'int main()':
a.cc:7:16: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
7 | scanf("%d" &a[i]);
| ~~~~ ^~~~~
| | |
| | int
| const char [3]
|
s674322252
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int a[10];
for(int i = 0; i < 10; i++)
scanf("%d" &a[i]);
for(int i = 0; i < 9; i++){
for(int j = i + 1; i < 10; i++){
if(a[i] > a[j])
swap(a[i], a[j]);
}
}
for(int i = 0; i < 3; i++){
printf("%d\n", a[i]);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:16: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
7 | scanf("%d" &a[i]);
| ~~~~ ^~~~~
| | |
| | int
| const char [3]
|
s045007709
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
itn data[10];
int main(){
for(int i=0;i<10;i++)cin>>data[i];
sort(data,data+10);
for(int i=0;i<3;i++)cout<<data[i]<<endl;
}
|
a.cc:4:1: error: 'itn' does not name a type; did you mean 'int'?
4 | itn data[10];
| ^~~
| int
a.cc: In function 'int main()':
a.cc:7:31: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
7 | for(int i=0;i<10;i++)cin>>data[i];
| ^
a.cc:8:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
8 | sort(data,data+10);
| ~~~~^~~
a.cc:10:31: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
10 | for(int i=0;i<3;i++)cout<<data[i]<<endl;
| ^
|
s624280471
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(int argc, const char * argv[])
{
int height[10];
for (int i=0; i<10; i++) {
cin >> height[i];
}
sort(height, height+10, greater<int>());
for (int i=0; i<3; i++) {
cout << height[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
11 | sort(height, height+10, greater<int>());
| ^~~~
| short
|
s815170356
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int top3Mountain[3];
memset(top3Mountain, 0, sizeof(top3Mountain));
for (int i=0; i<10; i++) {
int newHeight = 0;
scanf("%d", &newHeight);
if (top3Mountain[0] < newHeight) {
top3Mountain[2] = top3Mountain[1];
top3Mountain[1] = top3Mountain[0];
top3Mountain[0] = newHeight;
} else if (top3Mountain[1] < newHeight) {
top3Mountain[2] = top3Mountain[1];
top3Mountain[1] = newHeight;
} else if (top3Mountain[2] < newHeight) {
top3Mountain[2] = newHeight;
}
}
for (int i=0; i<3; i++) {
printf("%d\n", top3Mountain[i]);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:5: error: 'memset' was not declared in this scope
6 | memset(top3Mountain, 0, sizeof(top3Mountain));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 | using namespace std;
|
s309435968
|
p00001
|
C++
|
#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
#include<vector>
using namespace std;
int main(){
vector<int>ar(10);
for(auto&e:ar){
scanf("%d",&e);
}
sort(ar.begin(),ar.end());
printf("%d\n%d\n%d\n",ar[9],ar[8],ar[7]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
12 | sort(ar.begin(),ar.end());
| ^~~~
| sqrt
|
s313872051
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int d[10],i,j,tmp;
for(i=0;i<10;i++)
cin >> d[10];
for(i=0;i<9;i++)
{
for(l=i+1;j<10;j++)
{
if(d[i]<d[j])
{
tmp=d[i];
d[i]=d[j];
d[j]=tmp;
}
}
}
for(i=0;i<3;i++)
cout << d[i] <<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:13: error: 'l' was not declared in this scope
10 | for(l=i+1;j<10;j++)
| ^
|
s279340395
|
p00001
|
C++
|
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include<iostream>
using namespace std;
int main()
{
int d[10],i,j,tmp;
for(i=0;i<10;i++)
cin >> d[10];
for(i=0;i<9;i++)
{
for(j=i+1;j<10;j++)
{
if(d[i]<d[j])
{
tmp=d[i];
d[i]=d[j];
d[j]=tmp;
}
}
}
for(i=0;i<3;i++)
cout << d[i] <<endl;
return 0;
}
|
a.cc:2:1: error: expected unqualified-id before numeric constant
2 | 2
| ^
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:25:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
179 | _GLIBCXX_NODI
|
s773630539
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
int main(){
int a[10];
for(int i=0;i<10;i++)cin>>a[i];
sort(a,a+10);
for(int i=0;i<3;i++)cout<<a[i]<<endl;
}
|
a.cc: In function 'int main()':
a.cc:5:30: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | for(int i=0;i<10;i++)cin>>a[i];
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
6 | sort(a,a+10);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
a.cc:7:29: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | for(int i=0;i<3;i++)cout<<a[i]<<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:7:41: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | for(int i=0;i<3;i++)cout<<a[i]<<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)
| ^~~~
|
s105047152
|
p00001
|
C++
|
#include<stdio.h>
int main(void){
int i;
int a[10];
int x=0, y=0, z=0;
for(i=0;i<10;i++){
do{
printf("山の高さ%d(整数)",i+1);
scanf("%d",&a[i]);
}while(a[i]<0||10000<a[i])
if(a[i]>x){
z=y;
y=x;
x=a[i];
}
else if(a[i]>y){
z=y;
y=a[i];
}
else if(a[i]>z){
z=a[i];
}
}
printf("%d\n%d\n%d\n",x,y,z);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:43: error: expected ';' before 'if'
11 | }while(a[i]<0||10000<a[i])
| ^
| ;
12 |
13 | if(a[i]>x){
| ~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.