submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s146618765
|
p00001
|
C
|
d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
|
main.c:1:1: warning: data definition has no type or storage class
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^
main.c:1:9: error: expected declaration specifiers or '...' before '*' token
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^
main.c:1:26: error: return type defaults to 'int' [-Wimplicit-int]
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^~~~
main.c: In function 'main':
main.c:1:39: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
main.c:1:39: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^~~~~
main.c:1:39: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:53: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^~~~~
main.c:1:65: error: 'c' undeclared (first use in this function)
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^
main.c:1:65: note: each undeclared identifier is reported only once for each function it appears in
main.c:1:81: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^~~~~~
main.c:1:81: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:81: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:81: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:1:3: warning: array 'a' assumed to have one element
1 | d,a[];c(*z){d=*z-*1[&z];}main(){for(;~scanf("%d",a);qsort(a,4,4,c));for(d=4;--d;printf("%d\n",a[d]));}
| ^
|
s781447935
|
p00001
|
C
|
#include <stdio.h>
int main(void)
{
int m[10],i,n,r[10],t;
for(i=0;i!=10;i++)
{
scanf("%d",&m[i])
}
for (n=0;n!=10;n++)
{
t=10;
for (i=0;i!=10;i++)
{
if(m[n]>m[i])
{
t--;
}
}
r[n]=t;
}
for (n=1;n!=4;n++)
{
for (i=0;i!=10;i++)
{
if(r[i]==n)
{
printf("%d\n",m[i]);
}
}
}
return 0;
}
|
main.c: In function 'main':
main.c:7:24: error: expected ';' before '}' token
7 | scanf("%d",&m[i])
| ^
| ;
8 | }
| ~
|
s166442441
|
p00001
|
C
|
#include<stdio.h>
int main()
{
int a,b,c,d,e,f,g,h,i,j;
printf("type the heights of the mountains");
scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d &a,&b,&c,&d,&e,&f,&g,&h,&i,&j);
if(c>a && c>b && c>d && c>e && c>f && c>g && c>h && c>i && c>j)
printf("%the heighest mountain is: d", c);
else if(b>a && b>d && b>e && b>f && b>g && b>h && b>i && b>j)
printf("%the second heighest mountain is: d", b);
else if(a>d && a>e && a>f && a>g && a>h && a>i && a>j)
printf("%the third heighest mountain is: d", a);
return 0;
}
|
main.c: In function 'main':
main.c:6:7: warning: missing terminating " character
6 | scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d &a,&b,&c,&d,&e,&f,&g,&h,&i,&j);
| ^
main.c:6:7: error: missing terminating " character
6 | scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d &a,&b,&c,&d,&e,&f,&g,&h,&i,&j);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:7:1: error: expected expression before 'if'
7 | if(c>a && c>b && c>d && c>e && c>f && c>g && c>h && c>i && c>j)
| ^~
main.c:13:10: error: expected ';' before '}' token
13 | return 0;
| ^
| ;
14 | }
| ~
|
s885817256
|
p00001
|
C
|
#include <stdio.h>
int main (int argc, char* argv[])
{
int i, j, temp, height[10];
for (i=0; i<10; i++) {
scanf("%d", height[i]);
}
for (i=10; 0<i; i--) {
for (j=0; j<i; j++) {
if (height[j+1] < height[j]) {
temp = height[j];
heghit[j] = height[j+1];
height[j+1] = temp;
}
}
}
for (i=0; i<10; i++) {
printf("%d\n", height[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:15:9: error: 'heghit' undeclared (first use in this function); did you mean 'height'?
15 | heghit[j] = height[j+1];
| ^~~~~~
| height
main.c:15:9: note: each undeclared identifier is reported only once for each function it appears in
|
s971795650
|
p00001
|
C
|
#include<stdio.h>
int main(void){
int i,hx, tmp, d[10];
for(i = 0; i < 10; i++) scanf("%d", &d[i]);
for(h = 10; h > 0; ){
h /= 1.3;
for(i = 0; i + h < 10; i++){
if(d[i + h] < d[i]){
tmp = d[i];
d[i] = d[i + h];
d[i + h] = tmp;
}
}
}
for(i = 0; i < 3; i++) printf("%d\n", d[i]);
return 0;
}
|
main.c: In function 'main':
main.c:8:13: error: 'h' undeclared (first use in this function)
8 | for(h = 10; h > 0; ){
| ^
main.c:8:13: note: each undeclared identifier is reported only once for each function it appears in
|
s956334643
|
p00001
|
C
|
include <stdio.h>
int main(){
int a,b,c=0,d=0,e=0;
for(a=1;a<=10;a++){
scanf("%d",&b);
if(b>c){e=d;d=c;c=b;}
else if(b>d){e=d;d=b;}
else if(b>e){e=b;}
}
printf("%d\n%d\n%d\n",c,d,e);
return 0;
}
|
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s615671911
|
p00001
|
C
|
#include<iostream>
#define element 10
using namespace std;
int height[element];
int number;
int main()
{
for(int i=0;i<element;++i)
{
cin >> height[i];
}
for(int i=0;i<element;++i)
{
for(int j=i;j<element;++j)
{
if(height[i]<height[j])
{
number = height[i];
height[i] = height[j];
height[j] = number;
}
}
}
printf("\n%d\n%d\n%d\n",height[0],height[1],height[2]);
return 0;
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s250759279
|
p00001
|
C
|
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;
int main(){
vector<int> height(10);
for(int i=0; i<10; i++){
cin >>height[i];
}
sort(height.begin(),height.end(),greater<int>());
cout <<height[0]<<endl<<height[1]<<endl<<height[2]<<endl;
return 0;
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s543985719
|
p00001
|
C
|
#include<stdio.h>
int main(void){
int i,l,ans[3],t,in;
for(i=0;i<10;i++){
scanf(" %d",&in);
for(l=0;l<3;l++){
if(in>ans[l]){
t=ans[l];
ans[l]=in;
in=t;
}
}
for(i=0;i<3;i++)
printf("%d\n",ans[i]);
return 0;
}
|
main.c: In function 'main':
main.c:19:1: error: expected declaration or statement at end of input
19 | }
| ^
|
s501069675
|
p00001
|
C
|
#include<stdio.h>
int main(){
int x[10],i,j,a;
for(i=0;i<10;i++){
scanf("%d",&x[i]);
}
for(i=0;i<10;i++){
for(j=0;j<10;j++){
if(x[i]<x[j]){
a=x[i];
x[i]=x[j];
x[j]=a;
}
}
}
for(i=0;i<3;i++){
printf("%d\n",a[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:17:24: error: subscripted value is neither array nor pointer nor vector
17 | printf("%d\n",a[i]);
| ^
|
s405534257
|
p00001
|
C
|
#include<stdio.h>
int main(){
int h[10];
int i, j;
int M, idx;
char buf[8];
for(j = 0; j < 10; j++) {
gets(buf);
h[j] = strtol(buf, NULL, 10);
}
for(i = 0; i < 3; i++) {
M = 0;
for(j = 0; j < 10; j++) {
if (h[j] > M) {
M = h[j];
idx = j;
}
}
printf("%d\n", M);
h[idx] = 0;
}
return 0;
}
|
main.c: In function 'main':
main.c:10:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
10 | gets(buf);
| ^~~~
| fgets
main.c:11:24: error: implicit declaration of function 'strtol' [-Wimplicit-function-declaration]
11 | h[j] = strtol(buf, NULL, 10);
| ^~~~~~
|
s599589489
|
p00001
|
C
|
#include<stdio.h>
int main(){
int mountain[10];
scanf("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
int high[10]
for(i=0;i<=9;i++){
for(j=i+1;j<=10;i++){
if (mountain[i]<mountain[j]){
high[i] = mountain[i];
mountain[i] = mountain[j];
mountain[j] = high[i];
}
}
}
printf("mountain[0]")\n
printf("mountain[1]")\n
printf("mountain[2]")\n
return 0;
}
|
main.c: In function 'main':
main.c:6:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
6 | for(i=0;i<=9;i++){
| ^~~
main.c:6:5: error: 'i' undeclared (first use in this function)
6 | for(i=0;i<=9;i++){
| ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:7: error: 'j' undeclared (first use in this function)
7 | for(j=i+1;j<=10;i++){
| ^
main.c:9:7: error: 'high' undeclared (first use in this function)
9 | high[i] = mountain[i];
| ^~~~
main.c:15:40: error: stray '\' in program
15 | printf("mountain[0]")\n
| ^
main.c:15:40: error: expected ';' before 'n'
15 | printf("mountain[0]")\n
| ^~
| ;
main.c:16:42: error: stray '\' in program
16 | printf("mountain[1]")\n
| ^
main.c:17:44: error: stray '\' in program
17 | printf("mountain[2]")\n
| ^
|
s401251100
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a;
int mountain[10];
scanf("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
for(i=0;i<=9;i++){
for(j=i+1;j<=10;j++){
if (mountain[i]<mountain[j]){
a = mountain[i];
mountain[i] = mountain[j];
mountain[j] = high[i]
}
}
}
printf("mountain[0]")\n
printf("mountain[1]")\n
printf("mountain[2]")\n
return 0;
}
|
main.c: In function 'main':
main.c:6:5: error: 'i' undeclared (first use in this function)
6 | for(i=0;i<=9;i++){
| ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:7: error: 'j' undeclared (first use in this function)
7 | for(j=i+1;j<=10;j++){
| ^
main.c:11:23: error: 'high' undeclared (first use in this function)
11 | mountain[j] = high[i]
| ^~~~
main.c:11:30: error: expected ';' before '}' token
11 | mountain[j] = high[i]
| ^
| ;
12 | }
| ~
main.c:15:40: error: stray '\' in program
15 | printf("mountain[0]")\n
| ^
main.c:15:40: error: expected ';' before 'n'
15 | printf("mountain[0]")\n
| ^~
| ;
main.c:16:42: error: stray '\' in program
16 | printf("mountain[1]")\n
| ^
main.c:17:44: error: stray '\' in program
17 | printf("mountain[2]")\n
| ^
|
s356144384
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a;
int mountain[10];
scanf("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
for(int i=0;i<=9;i++){
for(int j=i+1;j<=10;j++){
if (mountain[i]<mountain[j]){
a = mountain[i];
mountain[i] = mountain[j];
mountain[j] = a;
}
}
printf("mountain[0]")\n
printf("mountain[1]")\n
printf("mountain[2]")\n
return 0;
}
|
main.c: In function 'main':
main.c:14:40: error: stray '\' in program
14 | printf("mountain[0]")\n
| ^
main.c:14:40: error: expected ';' before 'n'
14 | printf("mountain[0]")\n
| ^~
| ;
main.c:15:42: error: stray '\' in program
15 | printf("mountain[1]")\n
| ^
main.c:16:44: error: stray '\' in program
16 | printf("mountain[2]")\n
| ^
main.c:18:27: error: expected declaration or statement at end of input
18 | }
| ^
|
s335823336
|
p00001
|
C
|
#include<stdio.h>
int main()
{
int a;
int mountain[10];
scanf("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
for(int i=0;i<=9;i++){
for(int j=i+1;j<=10;j++){
if (mountain[i]<mountain[j+1]){
a = mountain[i];
mountain[i] = mountain[j];
mountain[j] = a;
}
}
printf("mountain[0]")\n
printf("mountain[1]")\n
printf("mountain[2]")\n
return 0;
}
|
main.c: In function 'main':
main.c:15:40: error: stray '\' in program
15 | printf("mountain[0]")\n
| ^
main.c:15:40: error: expected ';' before 'n'
15 | printf("mountain[0]")\n
| ^~
| ;
main.c:16:42: error: stray '\' in program
16 | printf("mountain[1]")\n
| ^
main.c:17:44: error: stray '\' in program
17 | printf("mountain[2]")\n
| ^
main.c:19:1: error: expected declaration or statement at end of input
19 | }
| ^
|
s764066352
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a;
int mountain[10];
scanf("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
int i;
int j;
for(i=0;i<=9;i++){
for(j=i+1;j<=10;j++){
if (mountain[i]<mountain[j+1]){
a = mountain[i];
mountain[i] = mountain[j];
mountain[j] = a;
}
}
printf("mountain[0]")\n
printf("mountain[1]")\n
printf("mountain[2]")\n
return 0;
}
|
main.c: In function 'main':
main.c:16:40: error: stray '\' in program
16 | printf("mountain[0]")\n
| ^
main.c:16:40: error: expected ';' before 'n'
16 | printf("mountain[0]")\n
| ^~
| ;
main.c:17:42: error: stray '\' in program
17 | printf("mountain[1]")\n
| ^
main.c:18:44: error: stray '\' in program
18 | printf("mountain[2]")\n
| ^
main.c:20:1: error: expected declaration or statement at end of input
20 | }
| ^
|
s141578719
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a;
int mountain[10];
scanf("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
int i;
int j;
for(i=0;i<=9;i++){
for(j=i+1;j<=10;j++){
if (mountain[i]<mountain[j+1]){
a = mountain[i];
mountain[i] = mountain[j];
mountain[j] = a;
}
}
printf("mountain[0]"\n)
printf("mountain[1]"\n)
printf("mountain[2]"\n)
return 0;
}
|
main.c: In function 'main':
main.c:16:39: error: stray '\' in program
16 | printf("mountain[0]"\n)
| ^
main.c:16:39: error: expected ')' before 'n'
16 | printf("mountain[0]"\n)
| ~ ^~
| )
main.c:16:42: error: expected ';' before 'printf'
16 | printf("mountain[0]"\n)
| ^
| ;
17 | printf("mountain[1]"\n)
| ~~~~~~
main.c:17:41: error: stray '\' in program
17 | printf("mountain[1]"\n)
| ^
main.c:18:43: error: stray '\' in program
18 | printf("mountain[2]"\n)
| ^
main.c:20:1: error: expected declaration or statement at end of input
20 | }
| ^
|
s227287365
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a;
int mountain[10];
scanf("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
int i;
int j;
for(i=0;i<=9;i++){
for(j=i+1;j<=10;j++){
if (mountain[i]<mountain[j+1]){
a = mountain[i];
mountain[i] = mountain[j];
mountain[j] = a;
}
}
printf("mountain[0]"\n)
printf("mountain[1]"\n)
printf("mountain[2]"\n)
return 0;
}
|
main.c: In function 'main':
main.c:16:37: error: stray '\' in program
16 | printf("mountain[0]"\n)
| ^
main.c:16:37: error: expected ')' before 'n'
16 | printf("mountain[0]"\n)
| ~ ^~
| )
main.c:16:40: error: expected ';' before 'printf'
16 | printf("mountain[0]"\n)
| ^
| ;
17 | printf("mountain[1]"\n)
| ~~~~~~
main.c:17:39: error: stray '\' in program
17 | printf("mountain[1]"\n)
| ^
main.c:18:41: error: stray '\' in program
18 | printf("mountain[2]"\n)
| ^
main.c:20:1: error: expected declaration or statement at end of input
20 | }
| ^
|
s411871070
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a;
int mountain[10];
scanf("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
int i;
int j;
for(i=0;i<=9;i++){
for(j=i+1;j<=10;j++){
if (mountain[i]<mountain[j]){
a = mountain[i];
mountain[i] = mountain[j];
mountain[j] = a;
}
}
printf("mountain[0]\n")
printf("mountain[1]\n")
printf("mountain[2]\n")
return 0;
}
|
main.c: In function 'main':
main.c:16:42: error: expected ';' before 'printf'
16 | printf("mountain[0]\n")
| ^
| ;
17 | printf("mountain[1]\n")
| ~~~~~~
main.c:20:1: error: expected declaration or statement at end of input
20 | }
| ^
|
s505080270
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a;
int mountain[10];
scanf("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
int x;
int y;
int z;
for(x=1;x<=9;x++){
if(mountain[0]<mountain[x]){
a = mountain[0]
mountain[0] = mountain[x]
mountain[x] = a
}
}
for(y=2;y<=9;y++){
if(mountain[1]<mountain[y]){
a = mountain[1]
mountain[1] = mountain[y]
mountain[y] = a
}
}
for(z=3;z<=9;x++){
if(mountain[2]<mountain[z]){
a = mountain[2]
mountain[2] = mountain[z]
mountain[z] = a
}
}
printf("mountain[0]\n");
printf("mountain[1]\n");
printf("mountain[2]\n");
return 0;
}
|
main.c: In function 'main':
main.c:11:20: error: expected ';' before 'mountain'
11 | a = mountain[0]
| ^
| ;
12 | mountain[0] = mountain[x]
| ~~~~~~~~
main.c:18:20: error: expected ';' before 'mountain'
18 | a = mountain[1]
| ^
| ;
19 | mountain[1] = mountain[y]
| ~~~~~~~~
main.c:25:20: error: expected ';' before 'mountain'
25 | a = mountain[2]
| ^
| ;
26 | mountain[2] = mountain[z]
| ~~~~~~~~
|
s762724813
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a;
int b;
int c;
int mountain[10];
gets("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
int x;
int y;
int z;
for(x=1;x<=9;x++){
if(mountain[0]<mountain[x]){
a = mountain[0];
mountain[0] = mountain[x];
mountain[x] = a;
}
}
for(y=2;y<=9;y++){
if(mountain[1]<mountain[y]){
b = mountain[1];
mountain[1] = mountain[y];
mountain[y] = b;
}
}
for(z=3;z<=9;x++){
if(mountain[2]<mountain[z]){
c = mountain[2];
mountain[2] = mountain[z];
mountain[z] = c;
}
}
printf("mountain[0]\n");
printf("mountain[1]\n");
printf("mountain[2]\n");
return 0;
}
|
main.c: In function 'main':
main.c:7:2: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | gets("%d%d%d%d%d%d%d%d%d%d",&mountain[0],&mountain[1],&mountain[2],&mountain[3],&mountain[4],&mountain[5],&mountain[6],&mountain[7],&mountain[8],&mountain[9]);
| ^~~~
| fgets
|
s680796747
|
p00001
|
C
|
#include<stdio.h>
int main(){
int i;
int a;
int mountain[10];
for(i =0;i<10;i++){
scanf("%d",&mountain[i]);
}
int x;
for(i=0;i<10;i++){
for(x=0;x<=2;x++){
if(mountain[x]<mountain[i]){
a = mountain[i];
mountain[x] = mountain[i];
mountain[i] = a;
}
}
}
printf("%d\n"&mountain[0] );
printf("%d\n"&mountain[1]);
printf("%d\n"&mountain[2]);
return 0;
}
|
main.c: In function 'main':
main.c:19:14: error: invalid operands to binary & (have 'char *' and 'int')
19 | printf("%d\n"&mountain[0] );
| ~~~~~~^~~~~~~~~~~~
| | |
| char * int
main.c:20:16: error: invalid operands to binary & (have 'char *' and 'int')
20 | printf("%d\n"&mountain[1]);
| ~~~~~~^~~~~~~~~~~~
| | |
| char * int
main.c:21:17: error: invalid operands to binary & (have 'char *' and 'int')
21 | printf("%d\n"&mountain[2]);
| ~~~~~~^~~~~~~~~~~~
| | |
| char * int
|
s335552814
|
p00001
|
C
|
#include<stdio.h>
int main(void)
{
int a[10+1],i,M1,M2,M3;
scanf("%d",&a[10+1]);
for(i=1;i<=3;i++) {
if(a>M1) {
a=M1;
}
if(M2<a && a<M1) {
a=M2;
}
if(M3<a && a<M2) {
a=M3;
}
printf("%d\n",a);
}
return 0;
}
|
main.c: In function 'main':
main.c:7:21: warning: comparison between pointer and integer
7 | if(a>M1) {
| ^
main.c:8:26: error: assignment to expression with array type
8 | a=M1;
| ^
main.c:10:22: warning: comparison between pointer and integer
10 | if(M2<a && a<M1) {
| ^
main.c:10:29: warning: comparison between pointer and integer
10 | if(M2<a && a<M1) {
| ^
main.c:11:26: error: assignment to expression with array type
11 | a=M2;
| ^
main.c:13:22: warning: comparison between pointer and integer
13 | if(M3<a && a<M2) {
| ^
main.c:13:29: warning: comparison between pointer and integer
13 | if(M3<a && a<M2) {
| ^
main.c:14:26: error: assignment to expression with array type
14 | a=M3;
| ^
|
s901238674
|
p00001
|
C
|
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main()
{
int i,ar[20];
for(i=0;i<10;i++)
{
scanf("%d",&ar[i]);
}
sort(ar,ar+i);
printf("%d\n%d\n%d\n",ar[i-1],ar[i-2],ar[i-3]);
return 0;
}
|
main.c:3:10: fatal error: algorithm: No such file or directory
3 | #include <algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s197792659
|
p00001
|
C
|
#include <cstdio>
#include <algorithm>
#include <vector>
int main(){
int i,x;
std::vector<int>v;
for(i=0;i<10;i++)scanf("%d",&x),v.push_back(x);
std::sort(v.begin(),v.end());
printf("%d\n%d\n%d\n",v[9],v[8],v[7]);
}
|
main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s322602048
|
p00001
|
C
|
#include<stdio.h>
int main(void){
double i,j,s=0,a[10],b[3];
for(i=0;i<10;i++)
scanf("%lld",&a[i]);
for(i=0;i<10;i++)
{
s=0;
for(j=0;j<10;j++)
{
if(a[j]>a[i])
s++;
}
if(s<3)
b[s]=a[i];
}
for(s=0;s<3;s++)
printf("%lld\n",b[s]);
return 0;
}
|
main.c: In function 'main':
main.c:6:20: error: array subscript is not an integer
6 | scanf("%lld",&a[i]);
| ^
main.c:12:12: error: array subscript is not an integer
12 | if(a[j]>a[i])
| ^
main.c:12:17: error: array subscript is not an integer
12 | if(a[j]>a[i])
| ^
main.c:16:10: error: array subscript is not an integer
16 | b[s]=a[i];
| ^
main.c:16:15: error: array subscript is not an integer
16 | b[s]=a[i];
| ^
main.c:19:23: error: array subscript is not an integer
19 | printf("%lld\n",b[s]);
| ^
|
s367238178
|
p00001
|
C
|
#include<stdio.h>
main(){
int c,i,j,temp,h[11];
for(c=0#include<stdio.h>
main(){
int c,i,j,temp,h[11];
for(c=0;c<10;c++){
scanf("%d",&h[c]);
}
for(i=0;i<3;i++){
for(j=c-1;j>0;j--){
if(h[j]>h[j-1]){
temp=h[j];
h[j]=h[j-1];
h[j-1]=temp;
}
}
}
printf("\n%d\n%d\n%d\n",h[0],h[1],h[2]);
return 0;
}
|
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:4:10: error: stray '#' in program
4 | for(c=0#include<stdio.h>
| ^
main.c:4:10: error: expected ';' before 'include'
4 | for(c=0#include<stdio.h>
| ^~~~~~~~
| ;
main.c:21:1: error: expected declaration or statement at end of input
21 | }
| ^
|
s162822390
|
p00001
|
C
|
#include <stdio.h>
int main() {
int a[10], i, max, t, j=3;
for(i=0; i<10; i++) scanf("%d", &a[i]);
while(j--) {
max=a[0]
for(i=1; i<10; i++) if(a[i]>max) { max=a[i]; t=i; }
printf("%d\n", max);
a[t]=0;
t=0;
}
return 0;
}
|
main.c: In function 'main':
main.c:6:15: error: expected ';' before 'for'
6 | max=a[0]
| ^
| ;
7 | for(i=1; i<10; i++) if(a[i]>max) { max=a[i]; t=i; }
| ~~~
|
s437514766
|
p00001
|
C
|
#include <stdio.h>
#include <stdlib.h>
int compare(int *a, int *b){
return *a - *b
}
int main(void){
int Height[10] = {0};
int i;
for(i=0; i < 10; i++){
scanf("%d", &Height[i]);
}
qsort(Height, 10, sizeof(int), compare);
printf("%d\n%d\n%d",Height[7],Height[8],Height[9]);
return 0;
}
|
main.c: In function 'compare':
main.c:5:23: error: expected ';' before '}' token
5 | return *a - *b
| ^
| ;
6 | }
| ~
main.c: In function 'main':
main.c:17:40: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
17 | qsort(Height, 10, sizeof(int), compare);
| ^~~~~~~
| |
| int (*)(int *, int *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(int *, int *)'
971 | __compar_fn_t __compar) __nonnull ((1, 4));
| ~~~~~~~~~~~~~~^~~~~~~~
|
s293277663
|
p00001
|
C
|
#pragma comment(linker, "/STACK:102400000,102400000")
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<cmath>
#include<cassert>
#include<cstring>
#include<iomanip>
using namespace std;
#ifdef _WIN32
#define i64 __int64
#define out64 "%I64d\n"
#define in64 "%I64d"
#else
#define i64 long long
#define out64 "%lld\n"
#define in64 "%lld"
#endif
/************ for topcoder by zz1215 *******************/
#define FOR(i,a,b) for( int i = (a) ; i <= (b) ; i ++)
#define FF(i,a) for( int i = 0 ; i < (a) ; i ++)
#define FFD(i,a,b) for( int i = (a) ; i >= (b) ; i --)
#define S64(a) scanf(in64,&a)
#define SS(a) scanf("%d",&a)
#define LL(a) ((a)<<1)
#define RR(a) (((a)<<1)+1)
#define pb push_back
#define pf push_front
#define X first
#define Y second
#define CL(Q) while(!Q.empty())Q.pop()
#define MM(name,what) memset(name,what,sizeof(name))
#define MC(a,b) memcpy(a,b,sizeof(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define read freopen("in.txt","r",stdin)
#define write freopen("out.txt","w",stdout)
const int inf = 0x3f3f3f3f;
const i64 inf64 = 0x3f3f3f3f3f3f3f3fLL;
const double oo = 10e9;
const double eps = 10e-9;
const double pi = acos(-1.0);
const int maxn = 400;
const int dir[4][2] = {{1,0},{-1,0},{0,1},{0,-1}};
struct zz
{
int x,y;
int x2,y2;
}zx;
int sx,sy,ex,ey;
int n;
vector<zz>v;
vector<int>fx;
vector<int>fy;
map<int,int>mx;
map<int,int>my;
int ix,iy;
int a[maxn][maxn];
int dp[maxn][maxn][4];
void gao(int x,int y,int x2,int y2)
{
for(int i=x;i<=x2;i++)
{
a[i][y]++;
}
for(int i=y+1;i<=y2;i++)
{
a[x][i]++;
a[x2][i]++;
}
for(int i=x+1;i<x2;i++)
{
a[i][y2]++;
}
for(int i=x+1;i<x2;i++)
{
for(int j=y+1;j<y2;j++)
{
a[i][j]=2;
}
}
return ;
}
struct aa
{
int x;
int y;
int z;
}ax;
bool inq[maxn][maxn][4];
bool yes(int x,int y)
{
if(x>=0 && x<=ix && y>=0 && y<=iy)
{
return true;
}
return false;
}
int bfs()
{
ix+=2;
iy+=2;
for(int i=0;i<=ix;i++)
{
for(int j=0;j<=iy;j++)
{
for(int u=0;u<4;u++)
{
dp[i][j][u]=inf;
inq[i][j][u]=false;
}
}
}
queue<aa>q;
for(int i=0;i<4;i++)
{
dp[sx][sy][i]=0;
inq[sx][sy][i]=true;
ax.x = sx;
ax.y = sy;
ax.z = i;
q.push(ax);
}
aa now,to;
int temp;
while(!q.empty())
{
now = q.front();
q.pop();
for(int i=0;i<4;i++)
{
to.x = now.x + dir[i][0];
to.y = now.y + dir[i][1];
to.z = i;
if(yes(to.x,to.y) && a[to.x][to.y]<2)
if(to.z == now.z)
{
temp = dp[now.x][now.y][now.z];
if(temp < dp[to.x][to.y][to.z])
{
dp[to.x][to.y][to.z] = temp;
if(!inq[to.x][to.y][to.z])
{
inq[to.x][to.y][to.z]=true;
q.push(to);
}
}
}
else
{
temp = dp[now.x][now.y][now.z]+1;
if(temp<dp[to.x][to.y][to.z])
{
dp[to.x][to.y][to.z] = temp;
if(!inq[to.x][to.y][to.z])
{
inq[to.x][to.y][to.z]=true;
q.push(to);
}
}
}
}
inq[now.x][now.y][now.z] = false;
}
int re = inf;
for(int i=0;i<4;i++)
{
re = min(dp[ex][ey][i],re);
}
if(re == inf)
{
re = -1;
}
return re;
}
int start()
{
MM(a,0);
for(int i=0;i<v.size();i++)
{
gao(mx[v[i].x],my[v[i].y],mx[v[i].x2],my[v[i].y2]);
}
return bfs();
}
int main()
{
while(cin>>sx>>sy>>ex>>ey)
{
if(!sx && !sy && !ex && !ey) return 0;
cin>>n;
fx.clear();
fy.clear();
mx.clear();
my.clear();
v.clear();
for(int i=1;i<=n;i++)
{
SS(zx.x);SS(zx.y);
SS(zx.x2);SS(zx.y2);
v.pb(zx);
fx.pb(zx.x);
fx.pb(zx.x2);
fy.pb(zx.y);
fy.pb(zx.y2);
}
fx.pb(sx);
fx.pb(ex);
fy.pb(sy);
fy.pb(ey);
sort(fx.begin(),fx.end());
sort(fy.begin(),fy.end());
ix = 1;
for(int i=0;i<fx.size();i++)
{
mx[fx[i]] = ix;
ix+=2;
}
iy = 1;
for(int i=0;i<fy.size();i++)
{
my[fy[i]] = iy;
iy+=2;
}
sx = mx[sx];
ex = mx[ex];
sy = my[sy];
ey = my[ey];
cout<<start()<<endl;
}
return 0;
}
|
main.c:2:13: fatal error: iostream: No such file or directory
2 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s061767083
|
p00001
|
C
|
#include <stdio.h>
int main (void){
int st = 0, nd =0 ,rd =0, tem, i;
for( i =0; i<10; i++){
scanf("%d",&s);
if ( tem >= st){
rd = nd;
nd = st;
st = tem;
continue ;
}
if ( tem > = nd) {
rd = nd;
nd =tem;
continue;
}
if ( tem > = rd) {
rd =tem;
continue;
}
}
printf("%d\n%d\n%d\n",st,nd,rd);
return 0;
}
|
main.c: In function 'main':
main.c:7:25: error: 's' undeclared (first use in this function)
7 | scanf("%d",&s);
| ^
main.c:7:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:26: error: expected expression before '=' token
14 | if ( tem > = nd) {
| ^
main.c:19:25: error: expected expression before '=' token
19 | if ( tem > = rd) {
| ^
|
s983317340
|
p00001
|
C
|
#include <stdio.h>
int main (void){
int st = 0, nd =0 ,rd =0, tem, i;
for( i =0; i<10; i++){
scanf("%d",&tem);
if ( tem >= st){
rd = nd;
nd = st;
st = tem;
continue ;
}
if ( tem > = nd) {
rd = nd;
nd =tem;
continue;
}
if ( tem > = rd) {
rd =tem;
continue;
}
}
printf("%d\n%d\n%d\n",st,nd,rd);
return 0;
}
|
main.c: In function 'main':
main.c:14:26: error: expected expression before '=' token
14 | if ( tem > = nd) {
| ^
main.c:19:25: error: expected expression before '=' token
19 | if ( tem > = rd) {
| ^
|
s786348226
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a[10],i,j,temp;
for(i=0;i<10;i++) scnaf("%d",&a[i]);
for(i=9;i>=0;i--){
for(j=0;j<=i;j++){
if(a[j] <a[j+1]){
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
for(i=0;i<3;i++) printf("%d\n",a[i]);
return 0;
}
|
main.c: In function 'main':
main.c:5:27: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
5 | for(i=0;i<10;i++) scnaf("%d",&a[i]);
| ^~~~~
| scanf
|
s403456721
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a[10],i,j,temp;
for(i=0;i<10;i++) scnaf("%d",&a[i]);
for(i=9;i>=0;i--){
for(j=0;j<=i;j++){
if(a[j] <a[j+1]){
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
for(i=0;i<3;i++) printf("%d\n",a[i]);
return 0;
}
|
main.c: In function 'main':
main.c:5:27: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
5 | for(i=0;i<10;i++) scnaf("%d",&a[i]);
| ^~~~~
| scanf
|
s306808547
|
p00001
|
C
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int a[10],i,j,temp;
for(i=0;i<10;i++) scnaf("%d",&a[i]);
for(i=9;i>=0;i--){
for(j=0;j<=i;j++){
if(a[j] <a[j+1]){
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
for(i=0;i<3;i++) printf("%d\n",a[i]);
return 0;
}
|
main.c: In function 'main':
main.c:6:27: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
6 | for(i=0;i<10;i++) scnaf("%d",&a[i]);
| ^~~~~
| scanf
|
s025935963
|
p00001
|
C
|
#include <stdio.h>
void swap(int &a,int &b);
int main(){
int i,data[10];
for(i=0;i<10;i++) scanf("%d",&data[i]);
for(i=0;i<3;i++){
for(int j=i+1;j<10;j++) if(data[j]>=data[i]) swap(data[i],data[j]);
}
printf("%d\n%d\n%d\n",data[0],data[1],data[2]);
return 0;
}
void swap(int &a,int &b){
int t;
t=a;
a=b;
b=t;
}
|
main.c:2:15: error: expected ';', ',' or ')' before '&' token
2 | void swap(int &a,int &b);
| ^
main.c: In function 'main':
main.c:7:62: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
7 | for(int j=i+1;j<10;j++) if(data[j]>=data[i]) swap(data[i],data[j]);
| ^~~~
main.c: At top level:
main.c:13:15: error: expected ';', ',' or ')' before '&' token
13 | void swap(int &a,int &b){
| ^
|
s674261707
|
p00001
|
C
|
#include <stdio.h>
void swap(int &a,int &b);
int main(){
int i,data[10];
for(i=0;i<10;i++) scanf("%d",&data[i]);
for(i=0;i<3;i++){
for(int j=i+1;j<10;j++) if(data[j]>=data[i]) swap(data[i],data[j]);
}
printf("%d\n%d\n%d\n",data[0],data[1],data[2]);
return 0;
}
void swap(int &a,int &b){
int t;
t=a;
a=b;
b=t;
}
|
main.c:2:15: error: expected ';', ',' or ')' before '&' token
2 | void swap(int &a,int &b);
| ^
main.c: In function 'main':
main.c:7:62: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
7 | for(int j=i+1;j<10;j++) if(data[j]>=data[i]) swap(data[i],data[j]);
| ^~~~
main.c: At top level:
main.c:13:15: error: expected ';', ',' or ')' before '&' token
13 | void swap(int &a,int &b){
| ^
|
s877882178
|
p00001
|
C
|
#include <stdio.h>
void swap(int &a,int &b){
int t;
t=a;
a=b;
b=t;
}
//void swap(int &a,int &b);
int main(){
int i,data[10];
for(i=0;i<10;i++) scanf("%d",&data[i]);
for(i=0;i<3;i++){
for(int j=i+1;j<10;j++) if(data[j]>=data[i]) swap(data[i],data[j]);
}
printf("%d\n%d\n%d\n",data[0],data[1],data[2]);
return 0;
}
void swap(int &a,int &b){
int t;
t=a;
a=b;
b=t;
}
|
main.c:2:15: error: expected ';', ',' or ')' before '&' token
2 | void swap(int &a,int &b){
| ^
main.c: In function 'main':
main.c:13:62: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
13 | for(int j=i+1;j<10;j++) if(data[j]>=data[i]) swap(data[i],data[j]);
| ^~~~
main.c: At top level:
main.c:19:15: error: expected ';', ',' or ')' before '&' token
19 | void swap(int &a,int &b){
| ^
|
s411686084
|
p00001
|
C
|
#include <stdio.h>
void swap(int *a,int *b){
int t;
t=*a;
*a=*b;
*b=t;
}
//void swap(int &a,int &b);
int main(){
int i,data[10];
for(i=0;i<10;i++) scanf("%d",&data[i]);
for(i=0;i<3;i++){
for(int j=i+1;j<10;j++) if(data[j]>=data[i]) swap(data[i],data[j]);
}
printf("%d\n%d\n%d\n",data[0],data[1],data[2]);
return 0;
}
|
main.c: In function 'main':
main.c:13:71: error: passing argument 1 of 'swap' makes pointer from integer without a cast [-Wint-conversion]
13 | for(int j=i+1;j<10;j++) if(data[j]>=data[i]) swap(data[i],data[j]);
| ~~~~^~~
| |
| int
main.c:2:16: note: expected 'int *' but argument is of type 'int'
2 | void swap(int *a,int *b){
| ~~~~~^
main.c:13:79: error: passing argument 2 of 'swap' makes pointer from integer without a cast [-Wint-conversion]
13 | for(int j=i+1;j<10;j++) if(data[j]>=data[i]) swap(data[i],data[j]);
| ~~~~^~~
| |
| int
main.c:2:23: note: expected 'int *' but argument is of type 'int'
2 | void swap(int *a,int *b){
| ~~~~~^
|
s883874566
|
p00001
|
C
|
#include<stdio.h>
int main(){
int a,max1=0,max2=0,max3=0,i;
for(i=0;i<10;i++){
scanf("%d",&a);
else if(max1<a){
max3=max2;
max2=max1;
max1=a;
}
else if(max2<a){
max3=max2;
max2=a;
}
else if(max3<a)
max3=a;
}
printf("%d\n%d\n%d\n",max1,max2,max3);
return 0;
}
|
main.c: In function 'main':
main.c:7:9: error: 'else' without a previous 'if'
7 | else if(max1<a){
| ^~~~
|
s323791483
|
p00001
|
C
|
#include<stdio.h>
int main()
{
int i,x,a=-1,b=-1,c=-1;
for(i=1;i<=10;i++)
{
scanf("%d",&x);
if(x>a)
{
c=b;
b=a;
a=x;
}
else if(x>b)
{
c=b;
b=x;
}
else if(x>c)
c=x;
}
printf("%d\n%d\n%d\n",a,b,c)
return 0;
}
|
main.c: In function 'main':
main.c:22:33: error: expected ';' before 'return'
22 | printf("%d\n%d\n%d\n",a,b,c)
| ^
| ;
23 | return 0;
| ~~~~~~
|
s507768464
|
p00001
|
C
|
/*
* Author: chlxyd
* Created Time: 2013/8/15 13:05:07
* File Name: 1006.cpp
*/
#include<iostream>
#include<sstream>
#include<fstream>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cmath>
#include<ctime>
using namespace std;
const double eps(1e-8);
typedef long long lint;
#define clr(x) memset( x , 0 , sizeof(x) )
#define sz(v) ((int)(v).size())
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repf(i, a, b) for (int i = (a); i <= (b); ++i)
#define repd(i, a, b) for (int i = (a); i >= (b); --i)
#define clrs( x , y ) memset( x , y , sizeof(x) )
char s[2][1100] ;
int dp[2][1100] ;
int f[2][1100] ;
char str[1100] ;
int n , T ;
void did( int k ) {
int len = strlen(s[k]) ;
int l = strlen(str) ;
repf( i , 1 , l ) dp[k][l] = -1 ;
dp[k][0] = 0 ;
clrs(f[k],-1) ;
rep( i , len ) {
repd( j , l - 1 , 1 )
if ( dp[k][j-1] != -1 && s[k][i] == str[j] ) {
dp[k][j] = max( dp[k][j] , dp[k][j-1] ) ;
if ( j == 1 ) dp[k][j] = i ;
if ( j == l - 1 ) {
f[k][i] = dp[k][1] ;
}
}
}
rep( i , len )
cout<<f[k][i]<<" ";
cout<<endl;
}
int main(){
scanf("%d" , &T ) ;
repf( t , 1 , T ) {
scanf("%s %s %s" , s[0] , s[1] , str ) ;
repf( i , 0 , 1 ) did(i);
//didup() ; diddown() ;
//printf("Case #%d: %d\n", t , solve() ) ;
}
}
|
main.c:6:9: fatal error: iostream: No such file or directory
6 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s998528793
|
p00001
|
C
|
#include <stdio.h>
int main(){
int i,a[10],b[3],f;
for(i=0;i<10;i++){
scanf("%d",&a[i]);
}
for(i=0;i<10;i++){
if(max2>max1 && max1<a[i]){
b[0]=a[i];
continue;
}
if(max3>max2 && max2<a[i]){
b[1]=a[i];
continue;
}
if(max3<a[i]){
b[2]=a[i];
continue;
}
}
for(i=0;i<2;i++){
if(b[i]<b[i+1]){
f=b[i];
b[i]=b[i+1];
b[i+1]=f;
}
}
if(b[0]<b[1]){
f=b[0];
b[0]=b[1];
b[1]=f;
}
printf("%d\n%d\n%d\n",b[0],b[1],b[2]);
return 0;
}
|
main.c: In function 'main':
main.c:9:4: error: 'max2' undeclared (first use in this function)
9 | if(max2>max1 && max1<a[i]){
| ^~~~
main.c:9:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:9: error: 'max1' undeclared (first use in this function)
9 | if(max2>max1 && max1<a[i]){
| ^~~~
main.c:13:4: error: 'max3' undeclared (first use in this function)
13 | if(max3>max2 && max2<a[i]){
| ^~~~
|
s067951277
|
p00001
|
C
|
#include<stdio.h>
#include<stlib.h>
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;
}
|
main.c:2:9: fatal error: stlib.h: No such file or directory
2 | #include<stlib.h>
| ^~~~~~~~~
compilation terminated.
|
s758318180
|
p00001
|
C
|
#include<stdio.h>
#include<stlib.h>
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;
}
|
main.c:2:9: fatal error: stlib.h: No such file or directory
2 | #include<stlib.h>
| ^~~~~~~~~
compilation terminated.
|
s282937326
|
p00001
|
C
|
#include<stdio.h>
#include<stdlib.h>
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;
}
|
main.c: In function 'main':
main.c:11:15: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
11 | a=max(a,max(n[f1],n[f2]));
| ^~~
|
s261588137
|
p00001
|
C
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int n[10],a,f,f1,f2;
for (f=0;f<10;f++){
scanf("%d",&n[f]);
}
for(f1=0;f1<10;f1++){
for(f2=0;f2<10;f2++){
a=max(a,max(n[f1],n[f2]));
}
}
printf("%d",a);
return 0;
}
|
main.c: In function 'main':
main.c:11:15: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
11 | a=max(a,max(n[f1],n[f2]));
| ^~~
|
s234291406
|
p00001
|
C
|
#include<stdio.h>
#include<stdlib.h>
int main(void){
int n[10]=0,a,f,f1,f2;
for (f=0;f<10;f++){
scanf("%d",&n[f]);
}
for(f1=0;f1<10;f1++){
for(f2=0;f2<10;f2++){
a=max(a,max(n[f1],n[f2]));
}
}
printf("%d",a);
return 0;
}
|
main.c: In function 'main':
main.c:5:15: error: invalid initializer
5 | int n[10]=0,a,f,f1,f2;
| ^
main.c:11:15: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
11 | a=max(a,max(n[f1],n[f2]));
| ^~~
|
s149247185
|
p00001
|
C
|
#include <stdio.h>
int main(){
int n,height,top[3];
for(n=1;n<=10;n++){
scanf("%d",&height);
if(top[0]<height){
top[2]=top[1];
top[1]=top[0];
top[0]=height;
}
else if(top[1]<height){
top[2]=top[1];
top[1]=height;
}
else if(top[2]<height){
top[2]=height;
}
}
for(n=0;n<3;n++)
printf("%d\n",top[n]);
}
return 0;
}
|
main.c:22:5: error: expected identifier or '(' before 'return'
22 | return 0;
| ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
23 | }
| ^
|
s830665091
|
p00001
|
C
|
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int h[10];
for(int i=0;i<10;i++) cin>>h[i];
int temp;
sort(h,h+10);
cout<<h[9]<<endl<<h[8]<<endl<<h[7];
}
|
main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s508825814
|
p00001
|
C
|
console.log('Hello World');
a
a
|
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | console.log('Hello World');
| ^
main.c:1:13: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
1 | console.log('Hello World');
| ^~~~~~~~~~~~~
main.c:3:1: error: unknown type name 'a'
3 | a
| ^
main.c:5:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
5 | a
| ^
|
s672749111
|
p00001
|
C
|
#include <stdio.h>
int main(){
int x[10],i,j,max[3];
for(i=0; i<10; i++){
scanf("%d",&x[i]);
}
max[0]=x[0];
for(i=0; i<10; i++){
if(x[i]>max[0]){
max[0]=x[i];
}
}
if(max[1]==x[0]){
max[1]=x[1];
} else [
max[1]=x[0]
}
for(i=0; i<10; i++){
if((x[i]>max[1]) && (x[i]<max[0])){
max[1]=x[i];
}
}
if(max[2]==x[0]){
max[2]=x[1];
} else [
max[2]=x[0]
}
for(i=0; i<10; i++){
if((x[i]>max[2]) && (x[i]<max[1])){
max[2]=x[i];
}
}
for(i=0; i<3; i++){
printf("%d\n",max[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:20:16: error: expected expression before '[' token
20 | } else [
| ^
main.c:21:28: error: expected ';' before '}' token
21 | max[1]=x[0]
| ^
| ;
22 | }
| ~
main.c: At top level:
main.c:24:9: error: expected identifier or '(' before 'for'
24 | for(i=0; i<10; i++){
| ^~~
main.c:24:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
24 | for(i=0; i<10; i++){
| ^
main.c:24:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
24 | for(i=0; i<10; i++){
| ^~
main.c:30:9: error: expected identifier or '(' before 'if'
30 | if(max[2]==x[0]){
| ^~
main.c:32:11: error: expected identifier or '(' before 'else'
32 | } else [
| ^~~~
main.c:36:9: error: expected identifier or '(' before 'for'
36 | for(i=0; i<10; i++){
| ^~~
main.c:36:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
36 | for(i=0; i<10; i++){
| ^
main.c:36:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
36 | for(i=0; i<10; i++){
| ^~
main.c:42:9: error: expected identifier or '(' before 'for'
42 | for(i=0; i<3; i++){
| ^~~
main.c:42:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
42 | for(i=0; i<3; i++){
| ^
main.c:42:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
42 | for(i=0; i<3; i++){
| ^~
main.c:46:9: error: expected identifier or '(' before 'return'
46 | return 0;
| ^~~~~~
main.c:48:1: error: expected identifier or '(' before '}' token
48 | }
| ^
|
s142188478
|
p00001
|
C
|
#include <stdio.h>
int main(){
int x[10],i,j,max[3];
for(i=0; i<10; i++){
scanf("%d",&x[i]);
}
max[0]=x[0];
for(i=0; i<10; i++){
if(x[i]>max[0]){
max[0]=x[i];
}
}
if(max[1]==x[0]){
max[1]=x[1];
} else {
max[1]=x[0]
}
for(i=0; i<10; i++){
if((x[i]>max[1]) && (x[i]<max[0])){
max[1]=x[i];
}
}
if(max[2]==x[0]){
max[2]=x[1];
} else {
max[2]=x[0]
}
for(i=0; i<10; i++){
if((x[i]>max[2]) && (x[i]<max[1])){
max[2]=x[i];
}
}
for(i=0; i<3; i++){
printf("%d\n",max[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:21:28: error: expected ';' before '}' token
21 | max[1]=x[0]
| ^
| ;
22 | }
| ~
main.c:33:28: error: expected ';' before '}' token
33 | max[2]=x[0]
| ^
| ;
34 | }
| ~
|
s834571981
|
p00001
|
C
|
#include<stdio.h>
#include<conio.h>
int main()
{
int a[100],i,mountain1,mountain2,mountain3;
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
mountain1=a[0];
for(i=1;i<10;i++)
{
if(mountain1<a[i])
{
mountain1=a[i];
}
}
mountain2=0;
for(i=0;i<10;i++)
{
if(a[i]<mountain1)
{
if(a[i]>mountain2)
mountain2=a[i];
}
}
mountain3=0;
for(i=0;i<10;i++)
{
if(mountain1>a[i] && mountain2>a[i])
{
if(a[i]>mountain3)
mountain3=a[i];
}
}
printf("\n%d\n%d\n%d\n",mountain1,mountain2,mountain3);
getch();
return 0;
}
|
main.c:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s245851080
|
p00001
|
C
|
#include<stdio.h>
#include<conio.h>
int main()
{
long long int s,d,t,n=0;
long long int i[15];
for(s=0;s<=9;s++)
{
scanf("%lld,",&i[s]);
}
for(d=0;d<=9;d++)
{
for(s=0;s<=9;s++)
{
if(i[d]<i[s])
{
t=i[s];
i[s]=i[d];
i[d]=t;
}
}
}
for(s=9;s>=7;s--)
{
printf("%lld\n",i[s]);
}
return 0;
}
|
main.c:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s070127581
|
p00001
|
C
|
#include<stdio.h>
#include<conio.h>
int main()
{
long long int s,d,t,n=0;
long long int i[15];
for(s=0;s<=9;s++)
{
scanf("%lld,",&i[s]);
}
for(d=0;d<=9;d++)
{
for(s=0;s<=9;s++)
{
if(i[d]<i[s])
{
t=i[s];
i[s]=i[d];
i[d]=t;
}
}
}
for(s=9;s>=8;s--)
{
printf("%lld\n",i[s]);
}
if(s==7){
printf("%lld",i[7]);
}
return 0;
}
|
main.c:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s366995524
|
p00001
|
C
|
#include <Stdio.h>
int max_of_array(int vc[], int n, int *num, int *num2) {
int i;
int max;
max = vc[0];
for(i = 0; i < n; i++) {
if((vc[i] > max) && (vc[i] != *num && vc[i] != *num2)) {
max = vc[i];
}
}
return(max);
}
int main(void) {
int moutain[10] = {0};
int i;
int n = -1, n1 = -1, n2 = -1;
for(i = 0; i < 10; i++) {
if(moutain[i] < 0 || moutain[i] > 10000)
break;
scanf("%d", &moutain[i]);
}
printf("%d\n", max_of_array(moutain, 10, &n, &n));
n1 = max_of_array(moutain, 10, &n, &n);
printf("n1 = %d\n", n1);
printf("%d\n", max_of_array(moutain, 10, &n1, &n1));
n2 = max_of_array(moutain, 10, &n1, &n1);
printf("n2 = %d\n", n2);
printf("%d\n", max_of_array(moutain, 10, &n2, &n1));
return(0);
}
|
main.c:1:10: fatal error: Stdio.h: No such file or directory
1 | #include <Stdio.h>
| ^~~~~~~~~
compilation terminated.
|
s868067478
|
p00001
|
C
|
#include <Stdio.h>
int max_of_array(int vc[], int n, int *num, int *num2) {
int i;
int max;
max = vc[0];
for(i = 0; i < n; i++) {
if((vc[i] > max) && (vc[i] != *num && vc[i] != *num2)) {
max = vc[i];
}
}
return(max);
}
int main(void) {
int moutain[10] = {0};
int i;
int n = -1, n1 = -1, n2 = -1;
for(i = 0; i < 10; i++) {
if(moutain[i] < 0 || moutain[i] > 10000)
break;
scanf("%d", &moutain[i]);
}
printf("%d\n", max_of_array(moutain, 10, &n, &n));
n1 = max_of_array(moutain, 10, &n, &n);
printf("%d\n", max_of_array(moutain, 10, &n1, &n1));
n2 = max_of_array(moutain, 10, &n1, &n1);
printf("%d\n", max_of_array(moutain, 10, &n2, &n1));
return(0);
}
|
main.c:1:10: fatal error: Stdio.h: No such file or directory
1 | #include <Stdio.h>
| ^~~~~~~~~
compilation terminated.
|
s278285880
|
p00001
|
C
|
#include <stdio.h>
#include <string.h>
int main(void)
{
int i,j,temp,input_int,rank[3] = {0};
char input[5];
char* p;
for (i = 0; i < 10; i++) {
fgets(input, sizeof(input),stdin);
p = strchr(input,'\n');
if (p != NULL) *p = '\0';
sscanf_s(input,"%d",&input_int);
for(j = 0; j < 3; j++)
{
if (rank[j] < input_int)
{
temp = rank[j];
rank[j] = input_int;
input_int = temp;
}
}
}
for (i = 0; i < 3; i++) {
printf("data[%d] = %d\n", i, rank[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:13:17: error: implicit declaration of function 'sscanf_s'; did you mean 'sscanf'? [-Wimplicit-function-declaration]
13 | sscanf_s(input,"%d",&input_int);
| ^~~~~~~~
| sscanf
|
s290628548
|
p00001
|
C
|
#include <stdio.h>
int main(){
int i,m,m1,m2,m3;
for(i=0;i<10;i++){
scanf("%d",&m);
if(i==0){
m1=m;
}
else if(i==1){
if(m>m1){
m2=m1;
m1=m;
}
else{
m2=m;
}
}
else if(i==2){
if(m>m2){
if(m>m1){
m3=m2;
m2=m1;
m1=m;
}
else{
m3=m2;
m2=m;
}
}
else{
m3=m;
}
}
else{
if(m>m3){
if(m>m2){
if(m>m1){
m3=m2;
m2=m1;
m1=m;
}
else{
m3=m2;
m2=m;
}
}
else{
m3=m;
}
}
}
}
printf("%d\n%d\n%d\n",m1,m2,m3);
return 0;
|
main.c: In function 'main':
main.c:54:5: error: expected declaration or statement at end of input
54 | return 0;
| ^~~~~~
|
s984528893
|
p00001
|
C
|
#include<stdio.h>
int main(void)
{
int i,j,k;
int mountain[10];
int top[3];
for(i=0;i<3;i++){
top[i]=0;
}
for(i=0;i<10;i++){
printf("山の高さ%d(整数):",i+1);
scanf("%d",&mountain[i]);
if(0<=mountain[i]||mountain[i]<=10000)
}
for(i=0;i<10;i++){
for(j=0;j<3;j++){
if(top[j]<mountain[i]){
if(j==0){
top[2]=top[1];
top[1]=top[0];
top[0]=mountain[i];
j=3;
}
else if(j==1){
top[2]=top[1];
top[1]=mountain[i];
j=3;
}
else if(j==2){
top[2]=mountain[i];
j=3;
}
}
}
}
for(i=0;i<3;i++){
printf("%d\n",top[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:15:9: error: expected expression before '}' token
15 | }
| ^
|
s352483242
|
p00001
|
C
|
#include <stdio.h>
int main(void)
{
unsigned int n,s,v;
unsigned int mountains[10];
for(n=0;n<10;n++)
scanf("%u",&mountains[n]);
for(s=1;s<=3;s++)
{
for(n=0;n<10;n++)
v=v<mountains[n]?mountains[n]:v;
printf("%u\n",v);
for(n=0;n<10;n++)
mountains[n]=v==mountains[n]?0:mountains[0];
}
return 0;[
}
|
main.c: In function 'main':
main.c:16:14: error: expected expression before '[' token
16 | return 0;[
| ^
main.c:16:15: error: expected ';' before '}' token
16 | return 0;[
| ^
| ;
17 | }
| ~
|
s123636421
|
p00001
|
C
|
#include<stdio.h>
int main()
{
int i,j,high[10],higher[3],flag=1,escape;
for(i=0;i<10;i++)
{
scanf("%d",&high[i]);
}
higher[0] = high[0];
higher[1] = high[1];
higher[2] = high[2];
while(flag)
{
for(i=0;i<2;i++)
{
if(higher[i]<higher[i+1])
{
escape[0] = higher[i];
higher[i] = higher[i+1];
higher[i+1] = escape;
}
}
if(higher[0] >= higher[1] && higher[1] >= higher[2])
{
flag = 0;
}
}
for(i=3;i<10;i++)
{
for(j=0;j<3;j++)
{
if(higher[j]<high[i])
{
if(j=0)
{
escape = higher[j];
higher[j] = high[i];
higher[j+2] = higher[j+1];
higher[j+1] = escape;
}
else if(j=1)
{
escape = higher[j];
higher[j] = high[i];
higher[j+1] = escape;
}
else
{
higher[j] = high[i];
}
}
}
}
printf("%d\n%d\n%d",higher[0],higher[1],higher[2]);
return 0;
}
|
main.c: In function 'main':
main.c:26:39: error: subscripted value is neither array nor pointer nor vector
26 | escape[0] = higher[i];
| ^
|
s598016320
|
p00001
|
C
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i,j,high[10],higher[3],flag=1,escape;
for(i=0;i<10;i++)
{
scanf("%d",&high[i]);
}
higher[0] = high[0];
higher[1] = high[1];
higher[2] = high[2];
while(flag)
{
for(i=0;i<2;i++)
{
if(higher[i]<higher[i+1])
{
escape[0] = higher[i];
higher[i] = higher[i+1];
higher[i+1] = escape;
}
}
if(higher[0] >= higher[1] && higher[1] >= higher[2])
{
flag = 0;
}
}
for(i=3;i<10;i++)
{
for(j=0;j<3;j++)
{
if(higher[j]<high[i])
{
if(j=0)
{
escape = higher[j];
higher[j] = high[i];
higher[j+2] = higher[j+1];
higher[j+1] = escape;
}
else if(j=1)
{
escape = higher[j];
higher[j] = high[i];
higher[j+1] = escape;
}
else
{
higher[j] = high[i];
}
}
}
}
printf("%d\n%d\n%d",higher[0],higher[1],higher[2]);
return 0;
}
|
main.c: In function 'main':
main.c:27:39: error: subscripted value is neither array nor pointer nor vector
27 | escape[0] = higher[i];
| ^
|
s418145710
|
p00001
|
C
|
int top3(int a[])
{
int i,j,k;
for(i=10;i>7;i--)
{
for(j=i;j>1;j--)
{
if(a[j]<a[j-1])
{
k=a[j];
a[j]=a[j-1];
a[j-1]=k;
}
}
}
return a[];
}
|
main.c: In function 'top3':
main.c:17:18: error: expected expression before ']' token
17 | return a[];
| ^
|
s252901292
|
p00001
|
C
|
#include<stdio.h>
#define N 10
int main()
{
int i, j, n, a=0;
int A[N];
for(i=0;i<10;i++){
scanf("%d", &n);
A[i] = n;
}
for(i=0;i<3;i++){
n = 0;
for(j=i1;j<N;j++){
if(n<A[j] && 0<=A[j] && A[j]<=10000){
n = A[j];
a = j;//max_index
}
}
n = A[i];
A[i] = A[a];
A[a] = n;
printf("%d\n",A[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:15:15: error: 'i1' undeclared (first use in this function); did you mean 'i'?
15 | for(j=i1;j<N;j++){
| ^~
| i
main.c:15:15: note: each undeclared identifier is reported only once for each function it appears in
|
s778218253
|
p00001
|
C
|
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <stdlib.h>
using namespace std;
int main()
{
int a[1000],i,j,k;
for(i=0;i<10;i++)
scanf("%d",&a[i]);
sort(a,a+i);
reverse(a,a+i);
for(i=0;i<3;i++)
printf("%d\n",a[i]);
return 0;
}
|
main.c:3:10: fatal error: algorithm: No such file or directory
3 | #include <algorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s448773536
|
p00001
|
C
|
#include<stdio.h>
int main(){
int i,j,height[10]rank[3],backup;
for(i=0;i<10;i++){
scanf("%d",height[i]);
}
for(j=0;j<10;j++){
for(i=0;i<9;i++){
if(height[i]>height[i+1]){
backup=height[i];
height[i]=height[i+1];
height[i+1]=backup;
}
}
}
for(i=0;i<3;i++){
rank[i]=height[9-i];
printf("%d\n",rank[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:4:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rank'
4 | int i,j,height[10]rank[3],backup;
| ^~~~
main.c:6:28: error: 'height' undeclared (first use in this function)
6 | scanf("%d",height[i]);
| ^~~~~~
main.c:6:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:33: error: 'backup' undeclared (first use in this function)
11 | backup=height[i];
| ^~~~~~
main.c:18:17: error: 'rank' undeclared (first use in this function)
18 | rank[i]=height[9-i];
| ^~~~
|
s336646700
|
p00001
|
C
|
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
int mountain[10] = {0};
int i, k, index;
int height = 0;
for (i = 0; i < 10; i++) {
cin >> mountain[i];
}
for (i = 0; i < 3; i++) {
height = 0;
for (k = 0; k < 10; k++) {
if (height < mountain[k]) {
height = mountain[k];
index = k;
}
}
cout << height <<endl;
mountain[index] = 0;
}
}
|
main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s859805420
|
p00001
|
C
|
#include<stdio.h>
int main(void)
{
int h[10],i,j,box;
for(i=0;i<10;i++){
scanf("%d",&h[i]);
for(i=0;i<9;i++){
for(j=i+1;j<10;j++){
if(h[i]<h[j]){
box=h[i];
h[i]=h[j];
h[j]=box;
}
}
}
for(i=0;i<3;i++)
printf("%d",h[i]);
return 0;
}
|
main.c: In function 'main':
main.c:19:1: error: expected declaration or statement at end of input
19 | }
| ^
|
s516022568
|
p00001
|
C
|
#include<stdio.h>
int main(void)
{
int h[10],i,j,box;
for(i=0;i<10;i++){
scanf("%d",&h[i]);
for(i=0;i<9;i++){
for(j=i+1;j<10;j++){
if(h[i]<h[j]){
box=h[i];
h[i]=h[j];
h[j]=box;
}
}
}
for(i=0;i<3;i++)
printf("%d\n",h[i]);
return 0;
}
|
main.c: In function 'main':
main.c:19:1: error: expected declaration or statement at end of input
19 | }
| ^
|
s741327255
|
p00001
|
C
|
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int first = 0;
int second = 0;
int third = 0;
for(int i=0;i<10;i++){
int current = input.nextInt();
if (current>third)
if(current>second){
if(current>first){
third = second;
second = first;
first = current;
}
else{
third=second;
second = current;
}
}
else third=current;
}
System.out.printf("%d\n%d\n%d", first, second, third);
}
}
|
main.c:1:1: error: unknown type name 'import'
1 | import java.util.Scanner;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.Scanner;
| ^
main.c:2:1: error: unknown type name 'public'
2 | public class Main{
| ^~~~~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
2 | public class Main{
| ^~~~
|
s559388845
|
p00001
|
C
|
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0001
|
main.c:1:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
1 | http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0001
| ^
|
s773205362
|
p00001
|
C
|
int main(){
int mcount=0;
int mbest3[4]={0,0,0,0};
while(scanf("[\n]%d",&mbest3[3])){
int ccount=0;
do{
int i=0;
for(;i<3;i++){}
if(mbest3[i]>mbest[i+1]){
mbest3[i]+=mbest[i+1];
mbest3[i+1]=mbest3[i]-mbest3[i+1];
mbest3[i]-=mbest3[i];
}
}while(ccount==0);
}
int i=0;
for(;i<3;i++){
printf("%d\n",mbest3[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:4:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | while(scanf("[\n]%d",&mbest3[3])){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(){
main.c:4:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | while(scanf("[\n]%d",&mbest3[3])){
| ^~~~~
main.c:4:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:38: error: 'mbest' undeclared (first use in this function); did you mean 'mbest3'?
9 | if(mbest3[i]>mbest[i+1]){
| ^~~~~
| mbest3
main.c:9:38: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
18 | printf("%d\n",mbest3[i]);
| ^~~~~~
main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:17: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s525470981
|
p00001
|
C
|
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int arr[11];
while(cin>>arr[0])
{
for(int i=1;i<10;i++)
{
cin>>arr[i];
}
sort(arr,arr+10);
cout<<arr[9]<<endl;
cout<<arr[8]<<endl;
cout<<arr[7]<<endl;
}
return 0;
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s835687445
|
p00001
|
C
|
#include<stdio.h>
int main(){
int i;
int a[10];
for(i=0;i<10;i++) scanf("%d",&a[i]);
int f=s=t=0;
for(i=0;i<10;i++)
{
if(a[i]>=a[f])
{
t=s;
s=f;
f=i;
}
else if(a[i]>=a[s])
{
t=s;
s=i;
}
else if(a[i]>=a[t])
{
t=i;
}
}
printf("%d\n%d\n%d\n",a[f],a[s],a[t]);
return 0;
}
|
main.c: In function 'main':
main.c:7:9: error: 's' undeclared (first use in this function)
7 | int f=s=t=0;
| ^
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:11: error: 't' undeclared (first use in this function)
7 | int f=s=t=0;
| ^
|
s275998143
|
p00001
|
C
|
#include<stdio.h>
int array[10],i,first=0,second=0,third=0;
int main(void){
for(i=0;i<10;i++){
printf("height of mountain %d(integer)",i+1);
scanf("%d",&array[i]);
}
for(i=0;i<10;i++){
if(array[i]>first){
third=second;
second=first;
first=array[i];
}
if(array[i]<first && array[i]>second){
third=second;
second=array[i];
}
if(array[i]<first && array[i]<second && array[i]>third){
third=array[i];
}
}
printf("%d\n%d\n%d\n",first,second,third);
return 0;
|
main.c: In function 'main':
main.c:33:9: error: expected declaration or statement at end of input
33 | return 0;
| ^~~~~~
|
s372996812
|
p00001
|
C
|
int height[10]={1819,2003,876,2840,1723,1673,3776,2848,1592,922};
int minh=10000;
int askmax(){
int maxh=0;
int maxindex=0;
for(int i=0;i<10;i++){
if(height[i]>height[maxindex]){
maxindex=i;
}
}
maxh=height[maxindex];
height[maxindex]=minh;
return maxh;
}
int askmin(){
for(int i=0;i<10;i++){
if(height[i]<minh){
minh=height[i];
}
}
return minh;
}
int main(){
minh=askmin();
printf("height of the 1st mountain %d\n",askmax());
printf("height of the 2nd mountain %d\n",askmax());
printf("height of the 3rd mountain %d\n",askmax());
}
|
main.c: In function 'main':
main.c:26:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
26 | printf("height of the 1st mountain %d\n",askmax());
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 | int height[10]={1819,2003,876,2840,1723,1673,3776,2848,1592,922};
main.c:26:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
26 | printf("height of the 1st mountain %d\n",askmax());
| ^~~~~~
main.c:26:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s168723927
|
p00001
|
C
|
#include <stdio.h>
int main(void){
int height[10]={0};
int i,j,temp;
for(i=0;i<10;i++){
scanf("%d",&height[i]);
for(i=0;i<9;i++){
for(j=i+1;j<10;j++){
if(height[i]<height[j]){
temp=height[i];
height[i]=height[j];
height[j]=temp;
}
}
}
for(i=0;i<3;i++){
printf("%d\n",height[i]);
}
return 0;
}
|
main.c: In function 'main':
main.c:20:1: error: expected declaration or statement at end of input
20 | }
| ^
|
s620272176
|
p00001
|
C
|
#include<stdio.h>
int main(void){
int a,b,c,d,e;
c=0,d=0,e=0;
for(a=0;a<10;a++){
scanf("%d",&b);
if(c=<b){
d=c;
c=b;
continue;
}else if(d=<b){
e=d;
d=b;
continue;
}else if(e=<b){
e=b;
continue;
}
} printf("%d\n%d\n%d\n",c,d,e);
return 0;
}
|
main.c: In function 'main':
main.c:7:14: error: expected expression before '<' token
7 | if(c=<b){
| ^
main.c:11:20: error: expected expression before '<' token
11 | }else if(d=<b){
| ^
main.c:15:20: error: expected expression before '<' token
15 | }else if(e=<b){
| ^
|
s538153283
|
p00001
|
C
|
#include<stdio.h>
int main(void){
int a,b,c,d,e;
c=0,d=0,e=0;
for(a=0;a<10;a++){
scanf("%d",&b);
if(c=<b){
d=c;
c=b;
continue;
}else if(d=<b){
e=d;
d=b;
continue;
}else if(e=<b){
e=b;
continue;
}
} printf("%d\n%d\n%d\n",c,d,e);
return 0;
}
|
main.c: In function 'main':
main.c:7:14: error: expected expression before '<' token
7 | if(c=<b){
| ^
main.c:11:20: error: expected expression before '<' token
11 | }else if(d=<b){
| ^
main.c:15:20: error: expected expression before '<' token
15 | }else if(e=<b){
| ^
|
s113489130
|
p00001
|
C
|
#include<stdio.h>
#include<conio.h>
int main(void)
{
int array[10],c,j,m,swap;
for(c=0;c<10;c++)
{
//printf("Please enter value for array[%d] : ",c);
scanf("\n%d",&array[c]);
}
printf("\n");
//printf("\nThe orignal values . . . \n");
//for(c=0;c<5;c++)
//printf("%d \t",array[c]);
for(c=0;c<9;c++)
{
m=c;
for(j=c+1;j<10;j++)
if(array[j]>array[m])
m=j;
if(m!=c)
{
swap=array[c];
array[c]=array[m];
array[m]=swap;
}
}
//printf("\nThe value in Descending order \n");
for(c=0;c<10;c++)
printf("%d\n",array[c]);
getch();
return 0;
}
|
main.c:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s905234822
|
p00001
|
C
|
#include<stdio.h>
int main(void) {
int height[10];
int i,j;
for(i=0; i<10; i++)
scanf("%d", &height[i]);
for(i=0,i<10;i++) {
for(j=i, j<10; j++) {
if(a[i] < a[j]) {
int swap =a[i];
a[i] = a[j];
a[j] = swap;
}
}
}
for(i=0; i<3; i++)
printf("%d\n", height[i]);
return 0;
}
|
main.c: In function 'main':
main.c:10:25: error: expected ';' before ')' token
10 | for(i=0,i<10;i++) {
| ^
| ;
main.c:11:35: error: expected ';' before ')' token
11 | for(j=i, j<10; j++) {
| ^
| ;
main.c:12:28: error: 'a' undeclared (first use in this function)
12 | if(a[i] < a[j]) {
| ^
main.c:12:28: note: each undeclared identifier is reported only once for each function it appears in
|
s570286943
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N ;
vector<int>Muntain(N);
for(int i = 0; i < N; i++){
cin >> Mountain(i);
}
sort(Mountain.begin(), Mountain.endl());
for(int j = 0; j < 3; j++){
cout << Mountain(j) << endl;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:8:12: error: 'Mountain' was not declared in this scope; did you mean 'Muntain'?
8 | cin >> Mountain(i);
| ^~~~~~~~
| Muntain
a.cc:10:8: error: 'Mountain' was not declared in this scope; did you mean 'Muntain'?
10 | sort(Mountain.begin(), Mountain.endl());
| ^~~~~~~~
| Muntain
a.cc: At global scope:
a.cc:16:3: error: expected declaration before '}' token
16 | }
| ^
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s540832618
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N ;
vector<int>Mountain(N);
for(int i = 0; i < N; i++){
cin >> Mountain(i);
}
sort(Mountain.begin(), Mountain.endl());
for(int j = 0; j < 3; j++){
cout << Mountain(j) << endl;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:8:20: error: no match for call to '(std::vector<int>) (int&)'
8 | cin >> Mountain(i);
| ~~~~~~~~^~~
a.cc:10:35: error: 'class std::vector<int>' has no member named 'endl'; did you mean 'end'?
10 | sort(Mountain.begin(), Mountain.endl());
| ^~~~
| end
a.cc:13:21: error: no match for call to '(std::vector<int>) (int&)'
13 | cout << Mountain(j) << endl;
| ~~~~~~~~^~~
a.cc: At global scope:
a.cc:16:3: error: expected declaration before '}' token
16 | }
| ^
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s381745479
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> mountain;
for(int i = 0; i < 10; i++){
cin >> mountian.at(i);
}
sort(moutain.begin(), moutain.end());
for (int i = 0; i < 3; i++) {
cout << moutain.at(i) << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:7:14: error: 'mountian' was not declared in this scope; did you mean 'mountain'?
7 | cin >> mountian.at(i);
| ^~~~~~~~
| mountain
a.cc:9:10: error: 'moutain' was not declared in this scope; did you mean 'mountain'?
9 | sort(moutain.begin(), moutain.end());
| ^~~~~~~
| mountain
a.cc: At global scope:
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s567384790
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> mountain;
for(int i = 0; i < 10; i++){
cin >> mountain.at(i);
}
sort(moutain.begin(), moutain.end());
for (int i = 0; i < 3; i++) {
cout << moutain.at(i) << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:9:10: error: 'moutain' was not declared in this scope; did you mean 'mountain'?
9 | sort(moutain.begin(), moutain.end());
| ^~~~~~~
| mountain
a.cc: At global scope:
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s756153267
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> mountain;
for(int i = 0; i < 10; i++){
cin >> mountain.at(i);
}
sort(mountain.begin(), mountain.end());
reverse(moutain.begin(), moutain.endl());
for (int i = 0; i < 3; i++) {
cout << mountain.at(i) << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:10:13: error: 'moutain' was not declared in this scope; did you mean 'mountain'?
10 | reverse(moutain.begin(), moutain.endl());
| ^~~~~~~
| mountain
|
s930766748
|
p00001
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int> mountain;
for(int i = 0; i < 10; i++){
cin >> mountain.at(i);
}
sort(mountain.begin(), mountain.end());
reverse(mountain.begin(), mountain.endl());
for (int i = 0; i < 3; i++) {
cout << mountain.at(i) << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:10:40: error: 'class std::vector<int>' has no member named 'endl'; did you mean 'end'?
10 | reverse(mountain.begin(), mountain.endl());
| ^~~~
| end
|
s948515875
|
p00001
|
C++
|
using namespace std;
int main(){
int x[10];
for (int i = 0; i < 10; i++){
cin >> x[i];
}
sort(begin(x), end(x));
cout << x[9];
cout << x[8];
cout << x[7];
}
|
a.cc: In function 'int main()':
a.cc:7:17: error: 'cin' was not declared in this scope
7 | cin >> x[i];
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 |
a.cc:9:14: error: 'begin' was not declared in this scope
9 | sort(begin(x), end(x));
| ^~~~~
a.cc:1:1: note: 'std::begin' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
+++ |+#include <iterator>
1 |
a.cc:9:24: error: 'end' was not declared in this scope
9 | sort(begin(x), end(x));
| ^~~
a.cc:9:24: note: 'std::end' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
a.cc:9:9: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(begin(x), end(x));
| ^~~~
| short
a.cc:10:9: error: 'cout' was not declared in this scope
10 | cout << x[9];
| ^~~~
a.cc:10:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s259973601
|
p00001
|
C++
|
int main(){
int x[10];
for (int i = 0; i < 10; i++){
cin >> x[i];
}
sort(begin(x), end(x));
cout << x[9];
cout << x[8];
cout << x[7];
}
|
a.cc: In function 'int main()':
a.cc:5:17: error: 'cin' was not declared in this scope
5 | cin >> x[i];
| ^~~
a.cc:7:14: error: 'begin' was not declared in this scope
7 | sort(begin(x), end(x));
| ^~~~~
a.cc:7:24: error: 'end' was not declared in this scope
7 | sort(begin(x), end(x));
| ^~~
a.cc:7:9: error: 'sort' was not declared in this scope; did you mean 'short'?
7 | sort(begin(x), end(x));
| ^~~~
| short
a.cc:8:9: error: 'cout' was not declared in this scope
8 | cout << x[9];
| ^~~~
|
s143819725
|
p00001
|
C++
|
//
// main.cpp
// kyougi
//
// Created by 寺林 一旭 on 2018/08/27.
// Copyright © 2018年 寺林 一旭. All rights reserved.
//
#include <iostream>
#include <vector>
using namespace std;
int main() {
int num;
vector<int> list;
while(cin)
{
cin >> num;
list.push_back(num);
}
sort(list.begin(), list.end(), greater<int>());
for(int i = 0 ; i< 3 ; i++)
{
cout<< list[i] <<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:22:5: error: 'sort' was not declared in this scope; did you mean 'short'?
22 | sort(list.begin(), list.end(), greater<int>());
| ^~~~
| short
|
s482376203
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int i;
vector<int> a;
int c;
for(i=0;i<10;i++)
{
cin>>c;
a.push_back(c)
}
sort(a.begin(),a.end());
cout<<a[9]<<endl<<a[8]<<endl<<a[7];
}
|
a.cc: In function 'int main()':
a.cc:14:17: error: expected ';' before '}' token
14 | a.push_back(c)
| ^
| ;
15 | }
| ~
|
s340529728
|
p00001
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
const int numOfMountain = 10;
int main(int argc, char* argv[]){
int mountainBuf;
vector<int> mountains;
for(int i = 0; i <= numOfMountain; i++) {
mountainBuf = atoi(argv[i]);
mountains.push_back(mountainBuf);
}
sort(mountains.begin(), mountains.end());
auto out = mountains.end();
for(int i = 0; i < 3; i++) {
cout << *--out << endl;
}
return 0;
}
|
a.cc: In function 'int main(int, char**)':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
17 | sort(mountains.begin(), mountains.end());
| ^~~~
| short
|
s623437137
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <iterator>
#include <cstdlib>
#include <algorithm>
using namespace std;
const int numOfMountain = 10;
int main(int argc, char** argv){
int mountainBuf;
vector<int> mountains;
for(int i = 0; i <= numOfMountain; i++) {
mountainBuf = atoi(argv[i]);
mountains.push_back(mountainBuf);
}
sort(mountains.begin(), mountains.end());
__wrap_iter out = mountains.end();
for(int i = 0; i < 3; i++) {
cout << *--out << endl;
}
return 0;
}
|
a.cc: In function 'int main(int, char**)':
a.cc:22:5: error: '__wrap_iter' was not declared in this scope
22 | __wrap_iter out = mountains.end();
| ^~~~~~~~~~~
a.cc:24:20: error: 'out' was not declared in this scope
24 | cout << *--out << endl;
| ^~~
|
s779676222
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int b[10];
for(int i=0;i<10;i++)
cin>>b[i];
int t;
for(i=0;i<3;i++)
{
for(int j=0;j+i<9;j++)
while(b[j]>b[j+1])
{ t=b[j];b[j]=b[j+1];b[j+1]=t;}
cout<<b[j]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:13: error: 'i' was not declared in this scope
9 | for(i=0;i<3;i++)
| ^
a.cc:14:25: error: 'j' was not declared in this scope
14 | cout<<b[j]<<endl;
| ^
|
s692178997
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int h;
int mh[3] = {0};
for(i=0;i<10;i++){
cin<<h;
if(mh[0] < h) mh[0] = h;
else if(mh[1] < h) mh[1] = h;
else if(mh[2] < h) mh[2] = h;
}
for(i=0;i<3;i++) cout<<mh[i]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:13: error: 'i' was not declared in this scope
9 | for(i=0;i<10;i++){
| ^
a.cc:10:20: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
10 | cin<<h;
| ~~~^~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:10:20: note: candidate: 'operator<<(int, int)' (built-in)
10 | cin<<h;
| ~~~^~~
a.cc:10:20: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<h;
| ^
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:17: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
10 | cin<<h;
| ^~~
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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<h;
| ^
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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<h;
| ^
/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:22: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin<<h;
| ^
/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:10:8: required from here
10 | cin<<h;
| ^
/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:17:13: error: 'i' was not declared in this scope
17 | for(i=0;i<3;i++) cout<<mh[i]<<endl;
| ^
|
s364124029
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(int argc, const char * argv[])
{
int *input = new int[10];
for(int i=0;i<10;i++){
cin >> input[i];
}
sort(input, input +10);
for(int i=0;i<3;i++){
cout << input[9-i] << endl;
}
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
16 | sort(input, input +10);
| ^~~~
| short
|
s253510391
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int h[10];
int i;
for(i=0;i<10;i++)cin>>h[i];
sort(h,h+10);
for(i=0;i<3;i++)cout<<h[i]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:1: error: 'sort' was not declared in this scope; did you mean 'short'?
7 | sort(h,h+10);
| ^~~~
| short
|
s283779989
|
p00001
|
C++
|
import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] array = new String[10];
int[] heights = new int[10];
for(int i=0; i<10; i++){
System.out.println("enter height: ");
array[i] = br.readLine();
heights[i] = Integer.parseInt(array[i]);
}
Arrays.sort(heights);
for(int i=9; i>6; i--){
System.out.println(heights[i]);
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
4 | public class Main{
| ^~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.