submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s648714763
|
p00002
|
C
|
c[];main(a,b){
for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(a+b,c,10)));
}
|
main.c:2:1: warning: data definition has no type or storage class
2 | c[];main(a,b){
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:2:5: error: return type defaults to 'int' [-Wimplicit-int]
2 | c[];main(a,b){
| ^~~~
main.c: In function 'main':
main.c:2:5: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:5: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:3:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(a+b,c,10)));
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 |
main.c:3:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(a+b,c,10)));
| ^~~~~
main.c:3:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:3:35: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(a+b,c,10)));
| ^~~~~~
main.c:3:35: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:3:35: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:3:35: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:3:49: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(a+b,c,10)));
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
+++ |+#include <string.h>
1 |
main.c:3:49: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(a+b,c,10)));
| ^~~~~~
main.c:3:49: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:3:57: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(a+b,c,10)));
| ~^~
| |
| int
main.c:3:57: note: expected 'const char *' but argument is of type 'int'
main.c:3:49: error: too many arguments to function 'strlen'
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(a+b,c,10)));
| ^~~~~~
main.c: At top level:
main.c:2:1: warning: array 'c' assumed to have one element
2 | c[];main(a,b){
| ^
|
s818533637
|
p00002
|
C
|
c[];main(a,b){
for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,c,10))));
}
|
main.c:2:1: warning: data definition has no type or storage class
2 | c[];main(a,b){
| ^
main.c:2:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:2:5: error: return type defaults to 'int' [-Wimplicit-int]
2 | c[];main(a,b){
| ^~~~
main.c: In function 'main':
main.c:2:5: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:2:5: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:3:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,c,10))));
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 |
main.c:3:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,c,10))));
| ^~~~~
main.c:3:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:3:35: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,c,10))));
| ^~~~~~
main.c:3:35: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:3:35: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:3:35: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:3:49: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,c,10))));
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
+++ |+#include <string.h>
1 |
main.c:3:49: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,c,10))));
| ^~~~~~
main.c:3:49: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:3:56: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,c,10))));
| ^~~~
main.c:3:56: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
3 | for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,c,10))));
| ^~~~~~~~~~~~~~
| |
| int
main.c:3:56: note: expected 'const char *' but argument is of type 'int'
main.c: At top level:
main.c:2:1: warning: array 'c' assumed to have one element
2 | c[];main(a,b){
| ^
|
s193239042
|
p00002
|
C
|
1 #include <stdio.h>
2
3 int main(int argc, char *argv[]){
4 int a,b,c,d;
5 while(1){
6 scanf("%d",&a);
7 if(a == EOF){
8 return 0;
9 }
10 scanf("%d",&b);
11 c = a+b;
12 d = 0;
13 while(c){
14 d++;
15 c /= 10;
16 }
17 printf("%d\n", d);
18 }
19 return 0;
20 }
|
main.c:1:3: error: expected identifier or '(' before numeric constant
1 | 1 #include <stdio.h>
| ^
main.c:1:5: error: stray '#' in program
1 | 1 #include <stdio.h>
| ^
|
s108681900
|
p00002
|
C
|
main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(,"%d",a+b)));}
|
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(,"%d",a+b)));}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(,"%d",a+b)));}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(,"%d",a+b)));}
main.c:1:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(,"%d",a+b)));}
| ^~~~~
main.c:1:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:37: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(,"%d",a+b)));}
| ^~~~~~
main.c:1:37: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:37: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:37: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:51: error: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(,"%d",a+b)));}
| ^~~~~~~
main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c:1:51: warning: incompatible implicit declaration of built-in function 'sprintf' [-Wbuiltin-declaration-mismatch]
main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c:1:59: error: expected expression before ',' token
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf(,"%d",a+b)));}
| ^
|
s595275460
|
p00002
|
C
|
main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
|
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
main.c:1:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
| ^~~~~
main.c:1:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:37: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
| ^~~~~~
main.c:1:37: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:37: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:37: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:51: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
| ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
+++ |+#include <string.h>
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
main.c:1:51: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
| ^~~~~~
main.c:1:51: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:1:58: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
| ^~~~
main.c:1:58: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",strlen(itoa(a+b,&a,10))));}
| ^~~~~~~~~~~~~~~
| |
| int
main.c:1:58: note: expected 'const char *' but argument is of type 'int'
|
s174106423
|
p00002
|
C
|
// aoj-1002.c
#include <iostream>
int main() {
int a, b, temp;
while(scanf("%d %d", &a, &b) != EOF) {
printf("%d\n", sprintf(temp, "%d", a+b));
}
return 0;
}
|
main.c:3:10: fatal error: iostream: No such file or directory
3 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s510344530
|
p00002
|
C
|
#include <stdio.h>
#include <string.h>
int main()
{
long long int m,n;
int i;
while(scanf("%lld %lld",&m,&n != EOF)
{
m += n;
i = 0;
while(m)
{
i++;
m /= 10;
}
printf("%d\n",i);
}
}
|
main.c: In function 'main':
main.c:8:39: warning: comparison between pointer and integer
8 | while(scanf("%lld %lld",&m,&n != EOF)
| ^~
main.c:8:46: error: expected ')' before '{' token
8 | while(scanf("%lld %lld",&m,&n != EOF)
| ~ ^
| )
9 | {
| ~
main.c:19:1: error: expected expression before '}' token
19 | }
| ^
|
s051074953
|
p00002
|
C
|
#include<stdio.h>
#include<math.h>
int main(void)
{
int a,b;
int i;
scanf("%d %d",&a,&b);
else printf("%d\n",(int)log10(a+b)+1);
return 0;
}
|
main.c: In function 'main':
main.c:9:2: error: 'else' without a previous 'if'
9 | else printf("%d\n",(int)log10(a+b)+1);
| ^~~~
|
s169590873
|
p00002
|
C
|
#include <stdio.h>
int main(void)
{
int a,b,c,i;
int n=1;
scanf("%d",&a);
scanf("%d",&b);
c=a+b;
for(i=1;i>0;i++){
c=c/10;
if(c==0){
break;
}
n++;
}
printf("%d",n);
return 0;
|
main.c: In function 'main':
main.c:21:1: error: expected declaration or statement at end of input
21 | return 0;
| ^~~~~~
|
s878405178
|
p00002
|
C
|
#include <stdio.h>
int main(int argc, char** argv){
int i, j, k, x[3], y[3];
for(k = 0; k < 3; k++) scanf("%d %d", &x[k], &y[k]);
for(k = 0; k < 3; k++){
for(i = 0, j = 1;(x + y) / j;i++, j *= 10);
printf("%d\n", i);
}
return 0;
}
|
main.c: In function 'main':
main.c:10:37: error: invalid operands to binary + (have 'int *' and 'int *')
10 | for(i = 0, j = 1;(x + y) / j;i++, j *= 10);
| ~ ^
| | |
| | int *
| int *
|
s755933361
|
p00002
|
C
|
include <stdio.h>
int main(){
int a,b,c,d;
while(scanf("%d %d",&a,&b) != EOF){
d=10;
for(c=1;c<=16;c++){
if(d>(a+b)) break;
d=d*10;
}
printf("%d\n",c);
}
return 0;
}
|
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s801815419
|
p00002
|
C
|
#include<stdio.h>
int main(){
int a=0;
|
main.c: In function 'main':
main.c:4:4: error: expected declaration or statement at end of input
4 | int a=0;
| ^~~
|
s034288648
|
p00002
|
C
|
#include<stdio.h>
int main(void)
{
int a,b,i,sum=0;count=0;
while (scanf("%d%d",&a,&b) != EOF){
sum=a+b;
for(;;){
sum=sum/10;
count++;
if(sum==0)
break;
}
printf("%d",count);
count=0;
}
return 0;
}
|
main.c: In function 'main':
main.c:4:25: error: 'count' undeclared (first use in this function)
4 | int a,b,i,sum=0;count=0;
| ^~~~~
main.c:4:25: note: each undeclared identifier is reported only once for each function it appears in
|
s135378590
|
p00002
|
C
|
#include<stdio.h>
int main(){
int a,b,ans[100],i,l,t;
for(i=0;;i++){
scanf("%d %d",&a,&b);
t=a+b;
if(t<0){
i=n;
break;
}
for(ans[i]=1;;){
t=(t-t%10)/10;
if(t>0)
ans[i]++;
else
break;
}
}
for(i=0;i<n;i++)printf("%d\n",ans[i]);
return 0;
}
|
main.c: In function 'main':
main.c:10:27: error: 'n' undeclared (first use in this function)
10 | i=n;
| ^
main.c:10:27: note: each undeclared identifier is reported only once for each function it appears in
|
s728919449
|
p00002
|
C
|
#include<stdio.h>
#incllude<string.h>
int main(){
int x,y,z;
scanf("%d %d",x,y);
x+=y;
z=strlen(x);
printf("%d",z);
return 0;
}
|
main.c:2:2: error: invalid preprocessing directive #incllude; did you mean #include?
2 | #incllude<string.h>
| ^~~~~~~~
| include
main.c: In function 'main':
main.c:7:7: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
7 | z=strlen(x);
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
1 | #include<stdio.h>
+++ |+#include <string.h>
2 | #incllude<string.h>
main.c:7:7: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
7 | z=strlen(x);
| ^~~~~~
main.c:7:7: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:7:14: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
7 | z=strlen(x);
| ^
| |
| int
main.c:7:14: note: expected 'const char *' but argument is of type 'int'
|
s880612168
|
p00002
|
C
|
#include <stdio.h>
int main(void)
{
  unsigned int A[1000], B[1000];
  unsigned int num;
  unsigned int keta;
  unsigned int i, j;
  for (i = 0;;i++){
    if (scanf("%d", &A[i]) == EOF)
      break;
    scanf("%d", &B[i]);
  }
  for (j = 0; j < i; j++){
    num = A[j] + B[j];
    for (keta = 0; num; keta++){
      num /= 10;
    }
    printf("%d\n", keta);
  }
  return 0;
}
|
main.c: In function 'main':
main.c:5:2: error: stray '#' in program
5 |   unsigned int A[1000], B[1000];
| ^
main.c:5:1: error: lvalue required as unary '&' operand
5 |   unsigned int A[1000], B[1000];
| ^
main.c:6:2: error: stray '#' in program
6 |   unsigned int num;
| ^
main.c:6:1: error: lvalue required as unary '&' operand
6 |   unsigned int num;
| ^
main.c:7:2: error: stray '#' in program
7 |   unsigned int keta;
| ^
main.c:7:1: error: lvalue required as unary '&' operand
7 |   unsigned int keta;
| ^
main.c:8:2: error: stray '#' in program
8 |   unsigned int i, j;
| ^
main.c:8:1: error: lvalue required as unary '&' operand
8 |   unsigned int i, j;
| ^
main.c:10:2: error: stray '#' in program
10 |   for (i = 0;;i++){
| ^
main.c:10:1: error: lvalue required as unary '&' operand
10 |   for (i = 0;;i++){
| ^
main.c:11:2: error: stray '#' in program
11 |     if (scanf("%d", &A[i]) == EOF)
| ^
main.c:11:1: error: lvalue required as unary '&' operand
11 |     if (scanf("%d", &A[i]) == EOF)
| ^
main.c:11:9: error: stray '#' in program
11 |     if (scanf("%d", &A[i]) == EOF)
| ^
main.c:11:8: error: lvalue required as unary '&' operand
11 |     if (scanf("%d", &A[i]) == EOF)
| ^
main.c:12:2: error: stray '#' in program
12 |       break;
| ^
main.c:12:1: error: lvalue required as unary '&' operand
12 |       break;
| ^
main.c:12:9: error: stray '#' in program
12 |       break;
| ^
main.c:12:8: error: lvalue required as unary '&' operand
12 |       break;
| ^
main.c:12:16: error: stray '#' in program
12 |       break;
| ^
main.c:12:15: error: lvalue required as unary '&' operand
12 |       break;
| ^
main.c:13:2: error: stray '#' in program
13 |     scanf("%d", &B[i]);
| ^
main.c:13:1: error: lvalue required as unary '&' operand
13 |     scanf("%d", &B[i]);
| ^
main.c:13:9: error: stray '#' in program
13 |     scanf("%d", &B[i]);
| ^
main.c:13:8: error: lvalue required as unary '&' operand
13 |     scanf("%d", &B[i]);
| ^
main.c:14:2: error: stray '#' in program
14 |   }
| ^
main.c:14:1: error: lvalue required as unary '&' operand
14 |   }
| ^
main.c:16:2: error: stray '#' in program
16 |   for (j = 0; j < i; j++){
| ^
main.c:16:1: error: lvalue required as unary '&' operand
16 |   for (j = 0; j < i; j++){
| ^
main.c:17:2: error: stray '#' in program
17 |     num = A[j] + B[j];
| ^
main.c:17:1: error: lvalue required as unary '&' operand
17 |     num = A[j] + B[j];
| ^
main.c:17:9: error: stray '#' in program
17 |     num = A[j] + B[j];
| ^
main.c:17:8: error: lvalue required as unary '&' operand
17 |     num = A[j] + B[j];
| ^
main.c:18:2: error: stray '#' in program
18 |     for (keta = 0; num; keta++){
| ^
main.c:18:1: error: lvalue required as unary '&' operand
18 |     for (keta = 0; num; keta++){
| ^
main.c:18:9: error: stray '#' in program
18 |     for (keta = 0; num; keta++){
| ^
main.c:18:8: error: lvalue required as unary '&' operand
18 |     for (keta = 0; num; keta++){
| ^
main.c:19:2: error: stray '#' in program
19 |       num /= 10;
| ^
main.c:19:1: error: lvalue required as unary '&' operand
19 |       num /= 10;
| ^
main.c:19:9: error: stray '#' in program
19 |       num /= 10;
| ^
main.c:19:8: error: lvalue required as unary '&' operand
19 |       num /= 10;
| ^
main.c:19:16: error: stray '#' in program
19 |       num /= 10;
| ^
main.c:19:15: error: lvalue required as unary '&' operand
19 |       num /= 10;
| ^
main.c:20:2: error: stray '#' in program
20 |     }
| ^
main.c:20:1: error: lvalue required as unary '&' operand
20 |     }
| ^
main.c:20:9: error: stray '#' in program
20 |     }
| ^
main.c:20:8: error: lvalue required as unary '&' operand
20 |     }
| ^
main.c:21:2: error: stray '#' in program
21 |     printf("%d\n", keta);
| ^
main.c:21:1: error: lvalue required as unary '&' operand
21 |     printf("%d\n", keta);
| ^
main.c:21:9: error: stray '#' in program
21 |     printf("%d\n", keta);
| ^
main.c:21:8: error: lvalue required as unary '&' operand
21 |     printf("%d\n", keta);
| ^
main.c:22:2: error: stray '#' in program
22 |   }
| ^
main.c:22:1: error: lvalue required as unary '&' operand
22 |   }
| ^
main.c:24:2: error: stray '#' in program
24 |   return 0;
| ^
main.c:24:1: error: lvalue required as unary '&' operand
24 |   return 0;
| ^
|
s750550145
|
p00002
|
C
|
#include <stdio.h>
#include <math.h>
int main(void){
int a,b;
while(scanf("%d%d",&a,&b) != EOF){
int x = a+b;
int digit = log(x)/log(10);
printf("%d\n",dight+1);
}
return 0;
}
|
main.c: In function 'main':
main.c:8:25: error: 'dight' undeclared (first use in this function); did you mean 'digit'?
8 | printf("%d\n",dight+1);
| ^~~~~
| digit
main.c:8:25: note: each undeclared identifier is reported only once for each function it appears in
|
s715663230
|
p00002
|
C
|
#include <stdio.h>
#include <math.h>
int main(void){
int a,b;
while(scanf("%d%d",&a,&b) != EOF){
double x = a+b;
double digit = log(x)/log(10.0);
int digitnew;
digitnew = floor(digit);
printf("%d\n",digitnew+1);
}
|
main.c: In function 'main':
main.c:11:1: error: expected declaration or statement at end of input
11 | }
| ^
|
s488944664
|
p00002
|
C
|
#include<stdio.h>
#define MAX_SIZE 256
int count(int num);
int main(){
int num[2];
int ans[MAX_SIZE];
int count = 0;
while(1)
{
scanf("%d %d", num, num+1);
if(num[0] == EOF)
{
break;
}
else
{
printf("%d\n", count(num[0] + num[1]));
}
}
return 0;
}
int count(int num)
{
int ans = 0;
while(num > 0)
{
ans++;
num /= 10;
}
return ans;
}
|
main.c: In function 'main':
main.c:20:40: error: called object 'count' is not a function or function pointer
20 | printf("%d\n", count(num[0] + num[1]));
| ^~~~~
main.c:9:13: note: declared here
9 | int count = 0;
| ^~~~~
|
s379106178
|
p00002
|
C
|
#include <stdio.h>
int main(void){
int FirstNum, SecondNum, Sum;
while(1){
if(scanf("%d %d",&FirstNum, &SecondNum); == EOF)
break;
Sum = FirstNum + SecondNum;
if (Sum < 10) printf("1\n"); goto label;
if (Sum < 100) printf("2\n"); goto label;
if (Sum < 1000) printf("3\n"); goto label;
if (Sum < 10000) printf("4\n"); goto label;
if (Sum < 100000) printf("5\n"); goto label;
if (Sum < 1000000) printf("6\n"); goto label;
if (Sum < 10000000) printf("7\n"); goto label;
label: ;
}
return 0;
}
|
main.c: In function 'main':
main.c:7:56: error: expected ')' before ';' token
7 | if(scanf("%d %d",&FirstNum, &SecondNum); == EOF)
| ~ ^
| )
|
s196222908
|
p00002
|
C
|
#include<stdio.h>
int main(){
int a,b;
while(scanf("%d%d",&a,&b) != EOF){
sprintf(temp,"%d",a+b);
printf("%d\n",strlen(temp));
}
return 0;
}
|
main.c: In function 'main':
main.c:6:25: error: 'temp' undeclared (first use in this function)
6 | sprintf(temp,"%d",a+b);
| ^~~~
main.c:6:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:31: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
7 | printf("%d\n",strlen(temp));
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
1 | #include<stdio.h>
+++ |+#include <string.h>
2 |
main.c:7:31: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
7 | printf("%d\n",strlen(temp));
| ^~~~~~
main.c:7:31: note: include '<string.h>' or provide a declaration of 'strlen'
|
s520823107
|
p00002
|
C
|
#include<stdio.h>
int main(){
int a,b;
while(scanf("%d%d",&a,&b) != EOF){
sprintf(temp,"%d",a+b);
printf("%d\n",temp);
}
return 0;
}
|
main.c: In function 'main':
main.c:6:25: error: 'temp' undeclared (first use in this function)
6 | sprintf(temp,"%d",a+b);
| ^~~~
main.c:6:25: note: each undeclared identifier is reported only once for each function it appears in
|
s717690029
|
p00002
|
C
|
#include <stdio.h>
int main (void){
int a,b,c = 1,d;
scanf("%d %d",a,b);
d = a+b
while ( d<10 ){
d = d/10;
c++;
}
printf("%d\n",c);
return 0;
}
|
main.c: In function 'main':
main.c:6:25: error: expected ';' before 'while'
6 | d = a+b
| ^
| ;
7 | while ( d<10 ){
| ~~~~~
|
s576738585
|
p00002
|
C
|
#include <stdio.h>
int main (void){
while(1){
int a,b,c = 1,d;
scanf("%d %d",a,b);
d = a+b
while ( d<10 ){
d = d/10;
c++;
}
printf("%d\n",c);
}
return 0;
}
|
main.c: In function 'main':
main.c:8:25: error: expected ';' before 'while'
8 | d = a+b
| ^
| ;
9 | while ( d<10 ){
| ~~~~~
|
s815930855
|
p00002
|
C
|
#include <stdio.h>
int main (void){
while(!a = \0){
int a,b,c = 1,d;
scanf("%d %d",a,b);
d = a+b;
while ( d<10 ){
d = d/10;
c++;
}
printf("%d\n",c);
}
return 0;
}
|
main.c: In function 'main':
main.c:5:18: error: 'a' undeclared (first use in this function)
5 | while(!a = \0){
| ^
main.c:5:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:22: error: stray '\' in program
5 | while(!a = \0){
| ^
|
s619008153
|
p00002
|
C
|
#include <stdio.h>
int main (void){
while(1){
int a,b,c = 1,d;
scanf("%d %d",a,b);
if( a = \0){
break;
}
else{
d = a+b;
while ( d<10 ){
d = d/10;
c++;
}
}
printf("%d\n",c);
}
return 0;
}
|
main.c: In function 'main':
main.c:8:25: error: stray '\' in program
8 | if( a = \0){
| ^
|
s872453815
|
p00002
|
C
|
#include <stdio.h>
int main (void){
while(1){
int a,b,c = 1,d;
scanf("%d %d",a,b);
if(a = \0){
break;
}
else{
d = a+b;
while ( d<10 ){
d = d/10;
c++;
}
}
printf("%d\n",c);
}
return 0;
}
|
main.c: In function 'main':
main.c:8:24: error: stray '\' in program
8 | if(a = \0){
| ^
|
s870651033
|
p00002
|
C
|
#include <stdio.h>
int main (void){
while(1){
int a,b,c = 1,d;
scanf("%d %d",a,b);
if(a=\0){
break;
}
else{
d=a+b;
while ( d<10 ){
d = d/10;
c++;
}
}
printf("%d\n",c);
}
return 0;
}
|
main.c: In function 'main':
main.c:8:22: error: stray '\' in program
8 | if(a=\0){
| ^
|
s025889688
|
p00002
|
C
|
#include <stdio.h>
int main (void){
while(1){
int a,b,c = 1,d;
scanf("%d %d",a,b);
if(a=\0){
break;
}
else{
d=a+b;
while ( d<10 ){
d = d/10;
c++;
}
}
printf("%d\n",c);
}
return 0;
}
|
main.c: In function 'main':
main.c:8:22: error: stray '\' in program
8 | if(a=\0){
| ^
|
s253965872
|
p00002
|
C
|
#include <stdio.h>
int main (void){
int a,b,c = 1,d;
while( scanf("%d %d",a,b) != eof)
d=a+b;
while ( d<10 ){
d = d/10;
c++;
}
printf("%d\n",c);
}
return 0;
}
|
main.c: In function 'main':
main.c:6:43: error: 'eof' undeclared (first use in this function); did you mean 'feof'?
6 | while( scanf("%d %d",a,b) != eof)
| ^~~
| feof
main.c:6:43: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:14:15: error: expected identifier or '(' before 'return'
14 | return 0;
| ^~~~~~
main.c:15:13: error: expected identifier or '(' before '}' token
15 | }
| ^
|
s800192441
|
p00002
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
int a,b;
while(1){
scanf("%d %d",&a,&b);
if( a == null){break;}
printf("%d",log10(a+b));
return 0;
}
|
main.c: In function 'main':
main.c:8:23: error: 'null' undeclared (first use in this function)
8 | if( a == null){break;}
| ^~~~
main.c:8:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:13: error: expected declaration or statement at end of input
11 | }
| ^
|
s564757825
|
p00002
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
int a,b;
while(1){
scanf("%d %d",&a,&b);
printf("%d",log10(a+b));
return 0;
}
|
main.c: In function 'main':
main.c:11:13: error: expected declaration or statement at end of input
11 | }
| ^
|
s342359800
|
p00002
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
int a,b;
while(scanf("%d %d",&a,&b) !=eof)
{
printf("%d",log10(a+b));
}
return 0;
}
|
main.c: In function 'main':
main.c:6:41: error: 'eof' undeclared (first use in this function); did you mean 'erf'?
6 | while(scanf("%d %d",&a,&b) !=eof)
| ^~~
| erf
main.c:6:41: note: each undeclared identifier is reported only once for each function it appears in
|
s485767825
|
p00002
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
int a,b,c;
while(scanf("%d %d",&a,&b) !=EOF)
{
c=1; c=c+log10(a+b)
printf("%d",c);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:35: error: expected ';' before 'printf'
9 | c=1; c=c+log10(a+b)
| ^
| ;
10 | printf("%d",c);
| ~~~~~~
|
s110039505
|
p00002
|
C
|
#include<stdio.h>
#include<math.h>
int main()
{
__int64 a,b;
while(scanf("%I64d%I64d",&a,&b)!=EOF)
{
printf("%I64d\n", (__int64)log10(a+b)+1);
}
}
|
main.c: In function 'main':
main.c:5:4: error: unknown type name '__int64'; did you mean '__int64_t'?
5 | __int64 a,b;
| ^~~~~~~
| __int64_t
main.c:8:26: error: '__int64' undeclared (first use in this function); did you mean '__int64_t'?
8 | printf("%I64d\n", (__int64)log10(a+b)+1);
| ^~~~~~~
| __int64_t
main.c:8:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:34: error: expected ')' before 'log10'
8 | printf("%I64d\n", (__int64)log10(a+b)+1);
| ~ ^~~~~
| )
|
s698063406
|
p00002
|
C
|
#include <stdio.h>
int main(void){
int i,a,b;
int c,count;
count=0;
while((scanf("%d %d",&a,&b)!=0)){
c=a+b;
while(){
c=c/10;
count++;
if(c==0)break;
}
printf("%d\n",count);
count=0;
}
return 0;
}
|
main.c: In function 'main':
main.c:9:11: error: expected expression before ')' token
9 | while(){
| ^
|
s158977343
|
p00002
|
C
|
#include <stdio.h>
int main(void){
int a,b,c;
while(scanf("%d %d",&a,&b)!=EOF){
c=a+b;
c/=10;
printf("%d\n,c+1);
}
return 0;
}
|
main.c: In function 'main':
main.c:7:13: warning: missing terminating " character
7 | printf("%d\n,c+1);
| ^
main.c:7:13: error: missing terminating " character
7 | printf("%d\n,c+1);
| ^~~~~~~~~~~
main.c:8:7: error: expected expression before '}' token
8 | }
| ^
main.c:7:13: error: expected ';' before '}' token
7 | printf("%d\n,c+1);
| ^
| ;
8 | }
| ~
|
s965138776
|
p00002
|
C
|
#include <stdio.h>
int main(void){
int a,b,c,n;
while(scanf("%d %d",&a,&b)!=EOF){
c=a+b;
for(n=1;c<10;n++){
c=c/10;
}
printf("%d\n,n);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:13: warning: missing terminating " character
9 | printf("%d\n,n);
| ^
main.c:9:13: error: missing terminating " character
9 | printf("%d\n,n);
| ^~~~~~~~~
main.c:10:7: error: expected expression before '}' token
10 | }
| ^
main.c:9:13: error: expected ';' before '}' token
9 | printf("%d\n,n);
| ^
| ;
10 | }
| ~
|
s136158052
|
p00002
|
C
|
#include <stdio.h> int main(void){ int a,b,c,n; while(scanf("%d %d",&a,&b)!=EOF){ c=a+b; for(n=1;c<10;n++){ c=c/10; } printf("%d\n",n); } return 0;}
|
main.c:1:22: warning: extra tokens at end of #include directive
1 | #include <stdio.h> int main(void){ int a,b,c,n; while(scanf("%d %d",&a,&b)!=EOF){ c=a+b; for(n=1;c<10;n++){ c=c/10; } printf("%d\n",n); } 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
|
s115619186
|
p00002
|
C
|
#include <stdio.h> int main( void ) { int a = 0; int b = 0; int Sum = 0; int i = 0; while( scanf( "%d %d", &a, &b ) != EOF ) { Sum = a + b; for( i = 0 ; Sum != 0 ; i ++ ) Sum /= 10; printf( "%d\n", i ); } return 0; }
|
main.c:1:22: warning: extra tokens at end of #include directive
1 | #include <stdio.h> int main( void ) { int a = 0; int b = 0; int Sum = 0; int i = 0; while( scanf( "%d %d", &a, &b ) != EOF ) { Sum = a + b; for( i = 0 ; Sum != 0 ; i ++ ) Sum /= 10; printf( "%d\n", 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
|
s991486491
|
p00002
|
C
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
int a,b;
char buff[10];
//入力終了までループ
while(scanf("%d %d", &a, &b) != EOF){
//intからcharに変換
itoa(a + b,buff,10);
//文字列の長さを出力
printf("%d\n", strlen(buff));
}
return 0;
}
|
main.c: In function 'main':
main.c:12:17: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
12 | itoa(a + b,buff,10);
| ^~~~
|
s543593638
|
p00002
|
C
|
#include <stdiuo.h>
int main(void)
{
unsigned long a,b,sum;
while(1){
int i;
int count=0;
scanf("%lu %lu",&a,&b);
sum = a+b;
while(sum>0){
sum /= 10;
count ++;
}
printf("%d",count);
}
return 0;
}
|
main.c:1:10: fatal error: stdiuo.h: No such file or directory
1 | #include <stdiuo.h>
| ^~~~~~~~~~
compilation terminated.
|
s172509208
|
p00002
|
C
|
#include<stdio.h>
int main(void){
int a,b;
while(scanf("%d%d"),&a,&b){
a+=b;
b=1;
while(a>=10){
a/=10;
b++:
}
printf("%d\n",b);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:16: error: expected ';' before ':' token
9 | b++:
| ^
| ;
|
s152788348
|
p00002
|
C
|
#include <stdio.h>
int main(){
int a,b,sum;
scanf("%d %d"&a,&b);
sum=keta(a)+keta(b);
printf("%d",sum);
return 0;
}
int keta(int n){
int k=1,m=0;
while(n/k>0){
m++;
k*=10;
}
return m;
}
|
main.c: In function 'main':
main.c:4:18: error: invalid operands to binary & (have 'char *' and 'int')
4 | scanf("%d %d"&a,&b);
| ~~~~~~~^
| |
| char *
main.c:5:9: error: implicit declaration of function 'keta' [-Wimplicit-function-declaration]
5 | sum=keta(a)+keta(b);
| ^~~~
|
s975191621
|
p00002
|
C
|
#include <stdio.h>
int main(){
int a,b,sum;
while(1){
scanf("%d %d"&a,&b);
if(a==0 || b==0){
break;
}
else{
sum=keta(a)+keta(b);
printf("%d",sum);
}
}
return 0;
}
int keta(int n){
int k=1,m=0;
while(n/k>0){
m++;
k*=10;
}
return m;
}
|
main.c: In function 'main':
main.c:5:22: error: invalid operands to binary & (have 'char *' and 'int')
5 | scanf("%d %d"&a,&b);
| ~~~~~~~^
| |
| char *
main.c:10:17: error: implicit declaration of function 'keta' [-Wimplicit-function-declaration]
10 | sum=keta(a)+keta(b);
| ^~~~
|
s708801279
|
p00002
|
C
|
#include <stdio.h>
int main(){
int a,b,sum;
while(true){
scanf("%d %d"&a,&b);
if(a<=0 || b<=0){
break;
}
else{
sum=keta(a)+keta(b);
printf("%d",sum);
}
}
return 0;
}
int keta(int n){
int k=1,m=0;
while(n/k>0){
m++;
k*=10;
}
return m;
}
|
main.c: In function 'main':
main.c:4:11: error: 'true' undeclared (first use in this function)
4 | while(true){
| ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdio.h>
+++ |+#include <stdbool.h>
2 | int main(){
main.c:4:11: note: each undeclared identifier is reported only once for each function it appears in
4 | while(true){
| ^~~~
main.c:5:22: error: invalid operands to binary & (have 'char *' and 'int')
5 | scanf("%d %d"&a,&b);
| ~~~~~~~^
| |
| char *
main.c:10:17: error: implicit declaration of function 'keta' [-Wimplicit-function-declaration]
10 | sum=keta(a)+keta(b);
| ^~~~
|
s713476942
|
p00002
|
C
|
#include <stdio.h>
int keta(int n);
int main(void){
int a,b;
while(scanf(("%d %d",&a,&b)!=EOF){
printf("%d",keta(a+b));
}
return 0;
}
int keta(int n){
int s=0,k=1;
while(n/k>0){
s++;
k*=10;
}
}
|
main.c: In function 'main':
main.c:5:32: warning: comparison between pointer and integer
5 | while(scanf(("%d %d",&a,&b)!=EOF){
| ^~
main.c:5:32: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Wint-conversion]
5 | while(scanf(("%d %d",&a,&b)!=EOF){
| ^
| |
| int
In file included from main.c:1:
/usr/include/stdio.h:428:42: note: expected 'const char *' but argument is of type 'int'
428 | extern int scanf (const char *__restrict __format, ...) __wur;
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:5:38: error: expected ')' before '{' token
5 | while(scanf(("%d %d",&a,&b)!=EOF){
| ~ ^
| )
main.c:9:1: error: expected expression before '}' token
9 | }
| ^
|
s968956576
|
p00002
|
C
|
int main(){for(int a,b;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));}
|
main.c: In function 'main':
main.c:1:25: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | int main(){for(int a,b;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(){for(int a,b;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));}
main.c:1:25: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | int main(){for(int a,b;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));}
| ^~~~~
main.c:1:25: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:45: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | int main(){for(int a,b;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));}
| ^~~~~~
main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:45: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:59: error: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration]
1 | int main(){for(int a,b;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));}
| ^~~~~~~
main.c:1:59: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c:1:59: warning: incompatible implicit declaration of built-in function 'sprintf' [-Wbuiltin-declaration-mismatch]
main.c:1:59: note: include '<stdio.h>' or provide a declaration of 'sprintf'
|
s048701680
|
p00002
|
C
|
main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
|
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
main.c:1:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
| ^~~~~
main.c:1:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:37: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
| ^~~~~~
main.c:1:37: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:37: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:37: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:51: error: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
| ^~~~~~~
main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c:1:51: warning: incompatible implicit declaration of built-in function 'sprintf' [-Wbuiltin-declaration-mismatch]
main.c:1:51: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c:1:81: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
main.c:1:81: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
| ^~~~
main.c:1:81: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:1:88: error: expected ';' before '}' token
1 | main(a,b){for(;~scanf("%d%d",&a,&b);printf("%d\n",sprintf((char*)&a,"%d",a+b)));exit(0)}
| ^
| ;
|
s522705920
|
p00002
|
C
|
#include<stdio.h>
int main()
{
int a, b, c = 1;
while(scanf("%d %d",&a,&b)!=EOF){
(a + b)% 10;
c++;
printf("%d\n",c);
if(a < 0 || b < 0)
break;
if(c > 200)
break;
}
return 0;
}
}
|
main.c:17:1: error: expected identifier or '(' before '}' token
17 | }
| ^
|
s459383787
|
p00002
|
C
|
main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x/=10;i++);printf("%d\n",i);}
|
main.c:1:11: error: expected ')' before '=' token
1 | main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x/=10;i++);printf("%d\n",i);}
| ^
| )
|
s447824401
|
p00002
|
C
|
main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);}
|
main.c:1:11: error: expected ')' before '=' token
1 | main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);}
| ^
| )
|
s615959731
|
p00002
|
C
|
main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);}
|
main.c:1:11: error: expected ')' before '=' token
1 | main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);}
| ^
| )
|
s674107501
|
p00002
|
C
|
main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);}
|
main.c:1:11: error: expected ')' before '=' token
1 | main(a,b,i=1,x){for(scanf("%d%d",&a,&b),x=a+b;x=x/10;i++);printf("%d\n",i);}
| ^
| )
|
s760369073
|
p00002
|
C
|
#include<stdio.h>
int a[10],b[10];
int main()
{
int i,la=0,lb=0,lmax,c,flag=0,t;
char ch;
for(i=1;i<=9;i++) //謨ー扈??蟋句喧
{
a[i]=0;
b[i]=0;
}
while((ch=getchar())!=EOF)
{
if(ch>='0'&&ch<='9')
{
if(flag==0)
{
a[++la]=ch-'0';
}
else if(flag==1)
{
b[++lb]=ch-'0';
}
}
else if(ch==' ')
{
flag=1;
}
else if(ch=='\n')
{
for(i=1;i<=la/2;i++) //a[]荳ュ螟ァ謨ー蛟堤スョ
{
t=a[i];
a[i]=a[la+1-i];
a[la+1-i]=t;
}
for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
{
t=b[i];
b[i]=b[lb+1-i];
b[lb+1-i]=t;
}
lmax=la>lb?la:lb;
c=0;
for(i=1;i<=lmax+1;i++) //螟壼、?炊荳?ス搾シ亥屏荳コ譛?ォ倅ス咲嶌蜉?庄閭ス譛芽ソ帑ス搾シ? {
t=a[i];
a[i]=(a[i]+b[i]+c)%10;
c=(t+b[i]+c)/10;
}
for(i=9;i>=0;i--)
{
if(a[i]!=0)
{
printf("%d\n",i);
break;
}
}
flag=0;
la=0;
lb=0;
for(i=1;i<=9;i++) //謨ー扈??鄂ョ
{
a[i]=0;
b[i]=0;
}
}
}
//譛?錘荳?サ?焚扈? for(i=1;i<=la/2;i++) //a[]荳ュ螟ァ謨ー蛟堤スョ
{
t=a[i];
a[i]=a[la+1-i];
a[la+1-i]=t;
}
for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
{
t=b[i];
b[i]=b[lb+1-i];
b[lb+1-i]=t;
}
lmax=la>lb?la:lb;
c=0;
for(i=1;i<=lmax;i++)
{
a[i]=(a[i]+b[i]+c)%10;
c=(a[i]+b[i]+c)/10;
}
for(i=9;i>=0;i--)
{
if(a[i]!=0)
{
printf("%d\n",i);
break;
}
}
return 0;
}
|
main.c:69:9: error: expected identifier or '(' before '{' token
69 | {
| ^
main.c:74:9: error: expected identifier or '(' before 'for'
74 | for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
| ^~~
main.c:74:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
74 | for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
| ^~
main.c:74:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
74 | for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
| ^~
main.c:80:9: warning: data definition has no type or storage class
80 | lmax=la>lb?la:lb;
| ^~~~
main.c:80:9: error: type defaults to 'int' in declaration of 'lmax' [-Wimplicit-int]
main.c:80:14: error: 'la' undeclared here (not in a function); did you mean 'a'?
80 | lmax=la>lb?la:lb;
| ^~
| a
main.c:80:17: error: 'lb' undeclared here (not in a function); did you mean 'b'?
80 | lmax=la>lb?la:lb;
| ^~
| b
main.c:81:9: warning: data definition has no type or storage class
81 | c=0;
| ^
main.c:81:9: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:82:9: error: expected identifier or '(' before 'for'
82 | for(i=1;i<=lmax;i++)
| ^~~
main.c:82:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
82 | for(i=1;i<=lmax;i++)
| ^~
main.c:82:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
82 | for(i=1;i<=lmax;i++)
| ^~
main.c:87:9: error: expected identifier or '(' before 'for'
87 | for(i=9;i>=0;i--)
| ^~~
main.c:87:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
87 | for(i=9;i>=0;i--)
| ^~
main.c:87:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
87 | for(i=9;i>=0;i--)
| ^~
main.c:95:9: error: expected identifier or '(' before 'return'
95 | return 0;
| ^~~~~~
main.c:96:1: error: expected identifier or '(' before '}' token
96 | }
| ^
|
s629895941
|
p00002
|
C
|
#include<stdio.h>
int a[10],b[10];
int main()
{
int i,la=0,lb=0,lmax,c,flag=0,t;
char ch;
for(i=1;i<=9;i++) //謨ー扈??蟋句喧
{
a[i]=0;
b[i]=0;
}
while((ch=getchar())!=EOF)
{
if(ch>='0'&&ch<='9')
{
if(flag==0)
{
a[++la]=ch-'0';
}
else if(flag==1)
{
b[++lb]=ch-'0';
}
}
else if(ch==' ')
{
flag=1;
}
else if(ch=='\n')
{
for(i=1;i<=la/2;i++) //a[]荳ュ螟ァ謨ー蛟堤スョ
{
t=a[i];
a[i]=a[la+1-i];
a[la+1-i]=t;
}
for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
{
t=b[i];
b[i]=b[lb+1-i];
b[lb+1-i]=t;
}
lmax=la>lb?la:lb;
c=0;
for(i=1;i<=lmax+1;i++) //螟壼、?炊荳?ス搾シ亥屏荳コ譛?ォ倅ス咲嶌蜉?庄閭ス譛芽ソ帑ス搾シ? {
t=a[i];
a[i]=(a[i]+b[i]+c)%10;
c=(t+b[i]+c)/10;
}
for(i=9;i>=0;i--)
{
if(a[i]!=0)
{
printf("%d\n",i);
break;
}
}
flag=0;
la=0;
lb=0;
for(i=1;i<=9;i++) //謨ー扈??鄂ョ
{
a[i]=0;
b[i]=0;
}
}
}
//譛?錘荳?サ?焚扈? for(i=1;i<=la/2;i++) //a[]荳ュ螟ァ謨ー蛟堤スョ
{
t=a[i];
a[i]=a[la+1-i];
a[la+1-i]=t;
}
for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
{
t=b[i];
b[i]=b[lb+1-i];
b[lb+1-i]=t;
}
lmax=la>lb?la:lb;
c=0;
for(i=1;i<=lmax;i++)
{
a[i]=(a[i]+b[i]+c)%10;
c=(a[i]+b[i]+c)/10;
}
for(i=9;i>=0;i--)
{
if(a[i]!=0)
{
printf("%d\n",i);
break;
}
}
return 0;
}
|
main.c:69:9: error: expected identifier or '(' before '{' token
69 | {
| ^
main.c:74:9: error: expected identifier or '(' before 'for'
74 | for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
| ^~~
main.c:74:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
74 | for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
| ^~
main.c:74:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
74 | for(i=1;i<=lb/2;i++) //b[]荳ュ螟ァ謨ー蛟堤スョ
| ^~
main.c:80:9: warning: data definition has no type or storage class
80 | lmax=la>lb?la:lb;
| ^~~~
main.c:80:9: error: type defaults to 'int' in declaration of 'lmax' [-Wimplicit-int]
main.c:80:14: error: 'la' undeclared here (not in a function); did you mean 'a'?
80 | lmax=la>lb?la:lb;
| ^~
| a
main.c:80:17: error: 'lb' undeclared here (not in a function); did you mean 'b'?
80 | lmax=la>lb?la:lb;
| ^~
| b
main.c:81:9: warning: data definition has no type or storage class
81 | c=0;
| ^
main.c:81:9: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:82:9: error: expected identifier or '(' before 'for'
82 | for(i=1;i<=lmax;i++)
| ^~~
main.c:82:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
82 | for(i=1;i<=lmax;i++)
| ^~
main.c:82:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
82 | for(i=1;i<=lmax;i++)
| ^~
main.c:87:9: error: expected identifier or '(' before 'for'
87 | for(i=9;i>=0;i--)
| ^~~
main.c:87:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
87 | for(i=9;i>=0;i--)
| ^~
main.c:87:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
87 | for(i=9;i>=0;i--)
| ^~
main.c:95:9: error: expected identifier or '(' before 'return'
95 | return 0;
| ^~~~~~
main.c:96:1: error: expected identifier or '(' before '}' token
96 | }
| ^
|
s139937729
|
p00002
|
C
|
scanf("%d %d",&a,&b);
|
main.c:1:7: error: expected declaration specifiers or '...' before string constant
1 | scanf("%d %d",&a,&b);
| ^~~~~~~
main.c:1:15: error: expected declaration specifiers or '...' before '&' token
1 | scanf("%d %d",&a,&b);
| ^
main.c:1:18: error: expected declaration specifiers or '...' before '&' token
1 | scanf("%d %d",&a,&b);
| ^
|
s233456807
|
p00002
|
C
|
#include <stdio.h>
#include <string.h>
int main(void)
{
int i,previous,next,digit,sum;
char input[30];
char* p;
for(i = 0; i < 2; i++)
{
fgets(input, sizeof(input),stdin);
p = strchr(input,'\n');
if (p != NULL) *p = '\0';
if(input == NULL) break;
sscanf(strtok(input, " "),"%d",&previous);
sscanf(strtok(NULL, " "),"%d",&next);
sum = previous + next;
digit = 0;
while(sum != 0) {
sum /= 10;
digit++;
}
printf("%d\n",digit);
}
return 0
}
|
main.c: In function 'main':
main.c:24:9: error: expected ';' before '}' token
24 | return 0
| ^
| ;
25 | }
| ~
|
s873471370
|
p00002
|
C
|
#include<stdio.h>
int main(void){
int a,b,c,i,j;
i=0;
while(scanf("%d %d",&a,&b)!=EOF&&i<200){
c=a+b;
j=0;
while(c>0){
c/=10;
j++;
}
printf("%d\n",d);
i++;
}
return 0;
}
|
main.c: In function 'main':
main.c:13:31: error: 'd' undeclared (first use in this function)
13 | printf("%d\n",d);
| ^
main.c:13:31: note: each undeclared identifier is reported only once for each function it appears in
|
s652612752
|
p00002
|
C
|
#include <stdio.h>
int main(){
int num1,num2,sum,counti;
while(1){
if(scanf("%d %d",&num1,&num2)==0)break;
sum=num1+num2;
count=0;
for(i=0;i<8;i++){
if(sum>=10^i){count++;}
printf("%d",count);
}
return 0;
}
|
main.c: In function 'main':
main.c:8:2: error: 'count' undeclared (first use in this function); did you mean 'counti'?
8 | count=0;
| ^~~~~
| counti
main.c:8:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:6: error: 'i' undeclared (first use in this function)
9 | for(i=0;i<8;i++){
| ^
main.c:14:1: error: expected declaration or statement at end of input
14 | }
| ^
|
s992434038
|
p00002
|
C
|
# include <stdio.h>
int main(void)
{
_int64 a,b;
while (scanf("%I64d %I64d",&a,&b)!=EOF)
{
printf("%I64d\n",a+b);
}
return 0;
}
|
main.c: In function 'main':
main.c:4:9: error: unknown type name '_int64'; did you mean '__int64_t'?
4 | _int64 a,b;
| ^~~~~~
| __int64_t
|
s327400835
|
p00002
|
C
|
#include <stdio.h>
#include <math.h>
int main(void)
{
int a,b;
while(scanf("%d%d",&a,&b) != EOF)
{
printf("%d\n",(int)(log10((double)(a+b))+1));
}
}
~
|
main.c:12:1: error: expected identifier or '(' before '~' token
12 | ~
| ^
|
s083963149
|
p00002
|
C
|
#include<stdio.h>
#include<conio.h>
int main ()
{
int n=1,j=0,i;
scanf("%d",&n);
int array[100];
if(i%n==0);
{
j++;
}
{
if (j==2);
}
{
printf("%d is prime",j);
}
return 0;
}
|
main.c:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s729003395
|
p00002
|
C
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(void)
{
int a,b,i,sum;
while(scanf("%d %d",&a,&b)!=EOF){
i=1;
sum=a+b;
printf("%d %d",a,b);dd
do{
sum=sum%10;
i++;
}while(sum>0);
printf("%d\n",i);
}
return 0;
}
|
main.c: In function 'main':
main.c:11:25: error: 'dd' undeclared (first use in this function)
11 | printf("%d %d",a,b);dd
| ^~
main.c:11:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:27: error: expected ';' before 'do'
11 | printf("%d %d",a,b);dd
| ^
| ;
12 | do{
| ~~
|
s432601881
|
p00002
|
C
|
#include<stdio.h>
int main(){
int a,b,d,i;
while(1)
{
d=1;
scanf("%d%d",&a,&b);
for(i=0;i<8;1++)
{
if(d<=(a+b)&&(d*10)>(a+b)){prinf("%d\n",d);break;}
else d=d*10;
}
}
}
|
main.c: In function 'main':
main.c:9:20: error: lvalue required as increment operand
9 | for(i=0;i<8;1++)
| ^~
main.c:11:38: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
11 | if(d<=(a+b)&&(d*10)>(a+b)){prinf("%d\n",d);break;}
| ^~~~~
| printf
|
s229709181
|
p00002
|
C
|
#include<stdio.h>
int main(){
int a,b,d,i,ret;
while(scanf("%d %d",&a,&b)=EOF)
{
d=1;
for(i=0;i<8;i++)
{
if(a+b==0){printf("1\n");break;}
if(d<=(a+b) && (d*10)>(a+b)){printf("%d\n",i+1);break;}
else d=d*10;
}
}
return 0;
}
|
main.c: In function 'main':
main.c:5:29: error: lvalue required as left operand of assignment
5 | while(scanf("%d %d",&a,&b)=EOF)
| ^
|
s423934458
|
p00002
|
C
|
#include<stdio.h>
int main(void){
int a,b,add,i;
scanf("%d %d",&a,&b);
add = a + b;
for(i = 0;add == 0;i++){
add /= 10;
}
printf("%d\n",i)
return 0;
}
|
main.c: In function 'main':
main.c:12:25: error: expected ';' before 'return'
12 | printf("%d\n",i)
| ^
| ;
13 |
14 | return 0;
| ~~~~~~
|
s920460369
|
p00002
|
C
|
#include<stdio.h>
int main(void){
int a,b,c,i,j=1,apple;
while(scanf("%d%d",&a,&b)!=EOF){
c=a+b;
for(i=0,j=1,apple=c;latte>=0;i++){
j=10*j;
apple=c-j;
}
printf("%d\n",i);
}
return 0;
}
|
main.c: In function 'main':
main.c:6:29: error: 'latte' undeclared (first use in this function)
6 | for(i=0,j=1,apple=c;latte>=0;i++){
| ^~~~~
main.c:6:29: note: each undeclared identifier is reported only once for each function it appears in
|
s789307071
|
p00002
|
C
|
#include窶ャ <stdio.h>
#include <stdllb.h>
int main()
{
int n, i, j, temp, count, ara[201], dif[200];
printf("How many elements: ");
scanf("%d", &n);
printf("Enter now %d elements: ", n);
for(i=0; i<n; i++) {
scanf("%d", &ara[i]);
}
for(i=0; i<n; i++) {
dif[i] = abs(ara[i+1]-ara[i]);
}
printf("difference: ");
for(i=0; i<(n-1); i++) {
printf("%d ", dif[i]);
}
printf("\n");
for(j=n-1; j>=1; j--) {
for(i=0; i<j; i++) {
temp = 0;
if(dif[i]>dif[i+1]) {
temp = dif[i];
dif[i] = dif[i+1];
dif[i+1] = temp;
}
}
}
printf("Sorting of difference: ");
for(i=0; i<(n-1); i++) {
printf("%d ", dif[i]);
}
count=0;
for(i=0; i<(n-1); i++) {
if(dif[i]==i+1) count++;
}
if(count==(n-1)) printf("Jolly\n");
else printf("Not jolly\n");
return 0;
}
|
main.c:1:2: error: invalid preprocessing directive #include\U00007ab6\U000030e3
1 | #include窶ャ <stdio.h>
| ^~~~~~~~~~~
main.c:2:10: fatal error: stdllb.h: No such file or directory
2 | #include <stdllb.h>
| ^~~~~~~~~~
compilation terminated.
|
s771886305
|
p00002
|
C
|
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b)
{
string str1;
ostringstream convert;
convert << (a+b);
str1= convert.str();
cout<<str1.size()<<endl;;
}
/* int num=111111110;
string res;
ostringstream convert;
convert <<num;
res=convert.str();
cout<<res<<endl;*/
}
|
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s304263031
|
p00002
|
C
|
#include <iostream>
using namespace std;
int main ()
{
int a,b;
while (cin >> a >> b)
{
int count = 0;
while (a != 0)
{
if(a%10 == 0)
{
a /=10;
continue;
}
count ++;
a /= 10;
}
while (b != 0)
{
if(b%10 == 0)
{
b /=10;
continue;
}
count ++;
b /= 10;
}
cout << count << endl;
}
return 0;
}
|
main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s978756392
|
p00002
|
C
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(void)
{
long int a,b,c,d;
char bb[7];
while((scanf("%d %d",&a,&b))==2)
{
c= a+b;
itoa(c,bb,10);
d = strlen(bb);
printf("%d\n",d);
}
return 0;
}
|
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
11 | itoa(c,bb,10);
| ^~~~
|
s787789211
|
p00002
|
C
|
#include <stdio.h>
int main(void) {
int a,b;
scanf("%d %d", &a, &b);
int ans = a+b;
for(int i = 0; ans > 0; i++) {
ans /= 10;
}
printf("%d",i);
return 0;
}
|
main.c: In function 'main':
main.c:13:21: error: 'i' undeclared (first use in this function)
13 | printf("%d",i);
| ^
main.c:13:21: note: each undeclared identifier is reported only once for each function it appears in
|
s287648423
|
p00002
|
C
|
#include <stdio.h>
int main(void) {
int a, b;
while(scanf("%d %d", &a, &b) == 2) {
printf("%d\n", strlen(sprintf("%d", a+b));
}
return 0;
}
|
main.c: In function 'main':
main.c:6:32: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
6 | printf("%d\n", strlen(sprintf("%d", a+b));
| ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
1 | #include <stdio.h>
+++ |+#include <string.h>
2 |
main.c:6:32: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
6 | printf("%d\n", strlen(sprintf("%d", a+b));
| ^~~~~~
main.c:6:32: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:6:54: error: passing argument 2 of 'sprintf' makes pointer from integer without a cast [-Wint-conversion]
6 | printf("%d\n", strlen(sprintf("%d", a+b));
| ~^~
| |
| int
In file included from main.c:1:
/usr/include/stdio.h:366:44: note: expected 'const char * restrict' but argument is of type 'int'
366 | const char *__restrict __format, ...) __THROWNL;
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:6:39: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
6 | printf("%d\n", strlen(sprintf("%d", a+b));
| ^~~~~~~~~~~~~~~~~~
| |
| int
main.c:6:39: note: expected 'const char *' but argument is of type 'int'
main.c:6:58: error: expected ')' before ';' token
6 | printf("%d\n", strlen(sprintf("%d", a+b));
| ~ ^
| )
main.c:6:59: error: expected ';' before '}' token
6 | printf("%d\n", strlen(sprintf("%d", a+b));
| ^
| ;
7 | }
| ~
|
s546954220
|
p00002
|
C
|
#include<stdio.h>
#include<math.h>
int main(void)
{
int a,b,i,sum[200];
for(i=0;i<200;i++){
scanf("%d %d",&a,&b);
sum[i]=a+b;
}
for(i=0;i<200;i++){
while(sum[i]<0){
int keta=0;
sum[i]/=10;
keta+=1;
}
printf("%d\n",keta);
}
return 0;
}
|
main.c: In function 'main':
main.c:19:19: error: 'keta' undeclared (first use in this function)
19 | printf("%d\n",keta);
| ^~~~
main.c:19:19: note: each undeclared identifier is reported only once for each function it appears in
|
s010908699
|
p00002
|
C
|
#include<stdio.h>
#include<math.h>
int main(void)
{
int a,b,i,keta,sum[200];
for(i=0;i<200;i++){
scanf("%d %d",&a,&b);
sum[i]=a+b;
}
for(i=0;i<200;i++){
while(sum[i]>=){
keta=0;
sum[i]/=10;
keta+=1;
}
printf("%d\n",keta);
}
return 0;
}
|
main.c: In function 'main':
main.c:14:19: error: expected expression before ')' token
14 | while(sum[i]>=){
| ^
|
s660895960
|
p00002
|
C
|
#include <stdio.h>
int digit(int x)
{
int x,i;
for(i=1;x/=10;i++)
return i
}
int main()
{
int a,b;
while(1){
scanf("%d %d",&a,&b);
printf("%d",digit(a+b));
}
return 0;
}
|
main.c: In function 'digit':
main.c:4:13: error: 'x' redeclared as different kind of symbol
4 | int x,i;
| ^
main.c:2:15: note: previous definition of 'x' with type 'int'
2 | int digit(int x)
| ~~~~^
main.c:6:17: error: expected ';' before '}' token
6 | return i
| ^
| ;
7 | }
| ~
|
s146635364
|
p00002
|
C
|
#include <stdio.h>
int digit(int x)
{
int x,i;
for(i=1;x/=10;i++)
return i;
}
int main()
{
int a,b;
while(1){
scanf("%d %d",&a,&b);
printf("%d",digit(a+b));
}
return 0;
}
|
main.c: In function 'digit':
main.c:4:13: error: 'x' redeclared as different kind of symbol
4 | int x,i;
| ^
main.c:2:15: note: previous definition of 'x' with type 'int'
2 | int digit(int x)
| ~~~~^
|
s444866105
|
p00002
|
C
|
#include<stdio.h>
int main(void)
{
int a,b,c,count=0;
while(scanf("%d %d",&a,&b)!=EOF){
c=a+b;
while(c>0){
c/=10;
count+=1;
}
printf("%d\n",count);
}
return 0
}
|
main.c: In function 'main':
main.c:15:11: error: expected ';' before '}' token
15 | return 0
| ^
| ;
16 | }
| ~
|
s700507339
|
p00002
|
C
|
#include<stdio.h>
#include<string.h>
int main(){
int a, b;
char c[16];
while(scanf("%d %d", &a, &b) != EOF) {
sprintf(c, "%d", a+b);
printf("%d\n", strlen(buf));
}
return 0;
}
|
main.c: In function 'main':
main.c:10:31: error: 'buf' undeclared (first use in this function)
10 | printf("%d\n", strlen(buf));
| ^~~
main.c:10:31: note: each undeclared identifier is reported only once for each function it appears in
|
s785026930
|
p00002
|
C
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace contest
{
class Program
{
static int Main(string[] args)
{
int MAX = 200;
char text_split = ' ';
for (int i = 0; i < MAX; i++)
{
string read = Console.ReadLine();
if (read == null) break;
else
{
string[] words = read.Split(text_split);
if( words[1] == null) break;
int a_num = int.Parse(words[0]);
int b_num = int.Parse(words[1]);
//出力
int ab = a_num + b_num;
int count = 1;
while (ab >= 10)
{
ab /= 10;
count++;
}
Console.WriteLine("{0}", count);
}
}
//Console.ReadKey();
return 0;
}
}
}
|
main.c:1:1: error: unknown type name 'using'
1 | using System;
| ^~~~~
main.c:2:1: error: unknown type name 'using'
2 | using System.Collections.Generic;
| ^~~~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
2 | using System.Collections.Generic;
| ^
main.c:3:1: error: unknown type name 'using'
3 | using System.Linq;
| ^~~~~
main.c:3:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
3 | using System.Linq;
| ^
main.c:4:1: error: unknown type name 'using'
4 | using System.Text;
| ^~~~~
main.c:4:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
4 | using System.Text;
| ^
main.c:6:1: error: unknown type name 'namespace'
6 | namespace contest
| ^~~~~~~~~
main.c:7:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
7 | {
| ^
|
s119916442
|
p00002
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,m,sum,c=0;
}
while(scanf("%d %d",&n,&m)!=EOF){
sum=n+m;
if(sum==0){
c++;
}
while(sum!=0){
sum=sum/10;
c++
}
}
cout<<c;
}
|
a.cc:7:9: error: expected unqualified-id before 'while'
7 | while(scanf("%d %d",&n,&m)!=EOF){
| ^~~~~
a.cc:17:9: error: 'cout' does not name a type
17 | cout<<c;
| ^~~~
a.cc:19:5: error: expected declaration before '}' token
19 | }
| ^
|
s655159407
|
p00002
|
C++
|
#include <iostream>
#include <string>
using namespace std;
string sum(string s, string t){
reverse(s.begin(), s.end());
reverse(t.begin(), t.end());
string res;
int carry = 0;
int md = max(t.size(), s.size());
for(int i=0; i<=md; i++){
int sc = i<s.size()? s[i]-'0': 0;
int tc = i<t.size()? t[i]-'0': 0;
int d = sc + tc + carry;
char nd = '0' + (d%10);
if(i == md && nd == '0')
continue;
res += nd;
carry = d/10;
}
reverse(res.begin(), res.end());
return res;
}
int main(){
string s, t;
while(cin >> s >> t){
cout << sum(s, t).size() << endl;
}
return 0;
}
|
a.cc: In function 'std::string sum(std::string, std::string)':
a.cc:6:5: error: 'reverse' was not declared in this scope
6 | reverse(s.begin(), s.end());
| ^~~~~~~
|
s575494852
|
p00002
|
C++
|
#include <iostream>
#include <string>
using namespace std;
string sum(string s, string t){
reverse(s.begin(), s.end());
reverse(t.begin(), t.end());
string res;
int carry = 0;
int md = max(t.size(), s.size());
for(int i=0; i<=md; i++){
int sc = i<s.size()? s[i]-'0': 0;
int tc = i<t.size()? t[i]-'0': 0;
int d = sc + tc + carry;
char nd = '0' + (d%10);
if(i == md && nd == '0')
continue;
res += nd;
carry = d/10;
}
reverse(res.begin(), res.end());
return res;
}
int main(){
string s, t;
while(cin >> s >> t){
cout << sum(s, t).size() << endl;
}
return 0;
}
|
a.cc: In function 'std::string sum(std::string, std::string)':
a.cc:6:5: error: 'reverse' was not declared in this scope
6 | reverse(s.begin(), s.end());
| ^~~~~~~
|
s287019101
|
p00002
|
C++
|
using System;
class main {
static void Main(){
string str;
while(true){
str = Console.ReadLine();
if(str == null) break;
string[] strs = str.Split();
Console.Write(strs[0].Length);
Console.WriteLine(" " + strs[1].Length);
}
}
}
|
a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:14:2: error: expected ';' after class definition
14 | }
| ^
| ;
a.cc: In static member function 'static void main::Main()':
a.cc:5:5: error: 'string' was not declared in this scope
5 | string str;
| ^~~~~~
a.cc:7:7: error: 'str' was not declared in this scope; did you mean 'std'?
7 | str = Console.ReadLine();
| ^~~
| std
a.cc:7:13: error: 'Console' was not declared in this scope
7 | str = Console.ReadLine();
| ^~~~~~~
a.cc:8:17: error: 'null' was not declared in this scope
8 | if(str == null) break;
| ^~~~
a.cc:9:14: error: expected primary-expression before ']' token
9 | string[] strs = str.Split();
| ^
a.cc:10:21: error: 'strs' was not declared in this scope
10 | Console.Write(strs[0].Length);
| ^~~~
|
s310463633
|
p00002
|
C++
|
/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
|
|
s617859486
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a,b;
while(eof){
cin>>a>>b;
int c=0;
int n;
n=a+b;
while (n>0){
c++;
n=n/10;
}
cout<<c<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:7:15: error: 'eof' was not declared in this scope; did you mean 'feof'?
7 | while(eof){
| ^~~
| feof
|
s132403739
|
p00002
|
C++
|
int main()
{
int a,b;
int count1=0,count2=0;
int sum;
while(scanf("%d%d",&a,&b)!= EOF)
{
while(a < 1000000 && a>0)
{
a /= 10;
count1++;
}
while(b < 1000000 && b>0)
{
b /= 10;
count2++;
}
sum = count1+count2;
printf("%d\n",sum);
count1=0;
count2=0;
sum=0;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf' was not declared in this scope
6 | while(scanf("%d%d",&a,&b)!= EOF)
| ^~~~~
a.cc:6:31: error: 'EOF' was not declared in this scope
6 | while(scanf("%d%d",&a,&b)!= EOF)
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main()
a.cc:19:4: error: 'printf' was not declared in this scope
19 | printf("%d\n",sum);
| ^~~~~~
a.cc:19:4: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s389835921
|
p00002
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
while(eof){
}
int n=a+b;
if (n>99999){
cout<<6<<endl;
}
else if(n>9999){
cout<<5<<endl;
}
else if(n>999){
cout<<4<<endl;
}
else if(n>99){
cout<<3<<endl;
}
else if(n>9){
cout<<2<<endl;
}
else{
cout<<1<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:7:7: error: 'eof' was not declared in this scope; did you mean 'feof'?
7 | while(eof){
| ^~~
| feof
|
s012111205
|
p00002
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
while(not eof){
}
int n=a+b;
if (n>99999){
cout<<6<<endl;
}
else if(n>9999){
cout<<5<<endl;
}
else if(n>999){
cout<<4<<endl;
}
else if(n>99){
cout<<3<<endl;
}
else if(n>9){
cout<<2<<endl;
}
else{
cout<<1<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:7:11: error: 'eof' was not declared in this scope; did you mean 'feof'?
7 | while(not eof){
| ^~~
| feof
|
s011084142
|
p00002
|
C++
|
int digits(int x)
{
if (x < 10)
return 1;
else
return 1 + digits(x / 10);
}
int main(int argc, char **argv)
{
int a, b;
while (cin >> a >> b) {
cout << digits(a+b) << endl;
}
return 0;
}
|
a.cc: In function 'int main(int, char**)':
a.cc:12:10: error: 'cin' was not declared in this scope
12 | while (cin >> a >> b) {
| ^~~
a.cc:13:5: error: 'cout' was not declared in this scope
13 | cout << digits(a+b) << endl;
| ^~~~
a.cc:13:28: error: 'endl' was not declared in this scope
13 | cout << digits(a+b) << endl;
| ^~~~
|
s413031696
|
p00002
|
C++
|
#include<cstdio>
#include<math.h>
using namespace std;
int countDigit(int num){
int i;
for(i=1;pow(10,i)<=num;i++);
return i;
}
int main(){
int i,a,b;
while(true)
scanf("%d %d",&a,&b);
printf("%d\n",countDigit(a+b));
}
return 0;
}
|
a.cc:18:5: error: expected unqualified-id before 'return'
18 | return 0;
| ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s497644977
|
p00002
|
C++
|
#include<cstdio>
#include<math.h>
using namespace std;
int countDigit(int num){
int i;
for(i=1;pow(10,i)<=num;i++);
return i;
}
int main(){
int i,a,b;
while(1)
scanf("%d %d",&a,&b);
printf("%d\n",countDigit(a+b));
}
return 0;
}
|
a.cc:18:5: error: expected unqualified-id before 'return'
18 | return 0;
| ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
s161630824
|
p00002
|
C++
|
#include<stdio.h>
#include<iostream>
using namespace std;
int main(void)
{
__int64 a,b;
while(scanf("%I64d %I64d",&a,&b)!=EOF)
{
__int64 sum;
sum=a+b;
int j=0;
while(sum!=0)
{
sum/=10;
j++;
}
printf("%d\n",j);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
6 | __int64 a,b;
| ^~~~~~~
| __int64_t
a.cc:7:32: error: 'a' was not declared in this scope
7 | while(scanf("%I64d %I64d",&a,&b)!=EOF)
| ^
a.cc:7:35: error: 'b' was not declared in this scope
7 | while(scanf("%I64d %I64d",&a,&b)!=EOF)
| ^
a.cc:9:15: error: expected ';' before 'sum'
9 | __int64 sum;
| ^~~~
| ;
a.cc:10:8: error: 'sum' was not declared in this scope
10 | sum=a+b;
| ^~~
|
s910190018
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int a, b;
while(cin >> a >> b){
int mas = a + b;
int n = 0
while(mas /= 10 != 0) n++
cout << n+1 << '\n';
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'while'
11 | while(mas /= 10 != 0) n++
| ^~~~~
|
s945573347
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int a, b;
while(cin >> a >> b){
int mas = a + b;
int n = 0
while(mas /= 10 != 0) n++;
cout << n+1 << '\n';
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'while'
11 | while(mas /= 10 != 0) n++;
| ^~~~~
|
s971747855
|
p00002
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int a, b;
while(cin >> a >> b){
int mas = a + b;
int n = 0
while(true){
n++;
mas /= 10;
if(mas == 0) break;
}
cout << n << '\n';
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'while'
11 | while(true){
| ^~~~~
|
s873528205
|
p00002
|
C++
|
#include <stdio.h>
#define N 16
int main(){
char temp[N];
int a[200],b[200];
int i,j,k,n;
char t[N];
for(i=0;i<200;i++){
fgets(temp,N,stdin);
if(temp[1]!='\0'){
sscanf_s(temp,"%d %d",&a[i],&b[i]);
}else{
j=i;
break;
}
//j=scanf_s("%d %d",&a[i],&b[i]);
//gets(t);
}
for(i=0;i<j;i++){
k=1,n=0;
while(a[i]+b[i]>=k){
k*=10;
n+=1;
}
printf("%d\n",n);
}
getchar();
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:25: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'?
11 | sscanf_s(temp,"%d %d",&a[i],&b[i]);
| ^~~~~~~~
| sscanf
|
s663244587
|
p00002
|
C++
|
#include <stdio.h>
#define N 16
int main(){
char temp[N];
int a[200],b[200];
int i,j,k,n;
for(i=0;i<200;i++){
fgets(temp,N,stdin);
if(temp[1]!='\0'){
sscanf_s(temp,"%d %d",&a[i],&b[i]);
}else{
j=i;
break;
}
}
for(i=0;i<j;i++){
k=1,n=0;
while(a[i]+b[i]>=k){
k*=10;
n+=1;
}
printf("%d\n",n);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:25: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'?
10 | sscanf_s(temp,"%d %d",&a[i],&b[i]);
| ^~~~~~~~
| sscanf
|
s762460494
|
p00002
|
C++
|
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
using namespace std;
const int MAXN = 100100;
struct Edge
{
int to,next;
}edge[MAXN*2];
int head[MAXN],tot;
int top[MAXN];//top[v]陦ィ遉コv謇?惠逧??體セ逧?。カ遶ッ闃らせ
int fa[MAXN]; //辷カ莠イ闃らせ
int deep[MAXN];//豺ア蠎ヲ
int num[MAXN];//num[v]陦ィ遉コ莉・v荳コ譬ケ逧?ュ先?逧?鰍轤ケ謨ー
int p[MAXN];//p[v]陦ィ遉コv荳主?辷カ莠イ闃らせ逧?ソ櫁セケ蝨ィ郤ソ谿オ譬台クュ逧?ス咲スョ
int fp[MAXN];//蜥継謨ー扈?嶌蜿?int son[MAXN];//驥榊?蟄?int pos;
void init()
{
tot = 0;
memset(head,-1,sizeof(head));
pos = 0;
memset(son,-1,sizeof(son));
}
inline void addedge(int u,int v)
{
edge[tot].to = v;edge[tot].next = head[u];head[u] = tot++;
}
void dfs1(int u,int pre,int d) //隨ャ荳?″dfs豎ょ?fa,deep,num,son
{
deep[u] = d;
fa[u] = pre;
num[u] = 1;
for(int i = head[u];i != -1; i = edge[i].next)
{
int v = edge[i].to;
if(v != pre)
{
dfs1(v,u,d+1);
num[u] += num[v];
if(son[u] == -1 || num[v] > num[son[u]])
son[u] = v;
}
}
}
inline void getpos(int u,int sp) //隨ャ莠碁″dfs豎ょ?top蜥継
{
top[u] = sp;
if(son[u] != -1)
{
p[u] = pos++;
fp[p[u]] = u;
getpos(son[u],sp);
}
else
{
p[u] = pos++;
fp[p[u]] = u;
return;
}
for(int i = head[u] ; i != -1; i = edge[i].next)
{
int v = edge[i].to;
if(v != son[u] && v != fa[u])
getpos(v,v);
}
}
//郤ソ谿オ譬?struct Node
{
int l,r;
long long sum;
long long lazy;
}segTree1[MAXN<<2],segTree2[MAXN<<2];
inline void build(Node segTree[],int i,int l,int r)
{
segTree[i].l = l;
segTree[i].r = r;
segTree[i].sum = 0;
segTree[i].lazy =0;
if(l == r)return;
int mid =((l+r)>>1);
build(segTree,i<<1,l,mid);
build(segTree,(i<<1)|1,mid+1,r);
}
inline void push_up(Node segTree[],int i)
{
segTree[i].sum= segTree[i<<1].sum+segTree[i<<1|1].sum;
}
inline void push_down(Node segTree[],int i){
if(segTree[i].lazy){
segTree[i<<1].lazy+=segTree[i].lazy;
segTree[i<<1|1].lazy+=segTree[i].lazy;
segTree[i<<1].sum+=(segTree[i<<1].r-segTree[i<<1].l+1)*segTree[i].lazy;
segTree[i<<1|1].sum+=(segTree[i<<1|1].r-segTree[i<<1|1].l+1)*segTree[i].lazy;
segTree[i].lazy=0;
}
}
inline void update(Node segTree[],int i,int l,int r,int val)//譖エ譁ー蛹コ髣エ
{
if(segTree[i].l == l && segTree[i].r == r)
{
segTree[i].lazy+= val;
segTree[i].sum+=(segTree[i].r-segTree[i].l+1)*val;
return;
}
push_down(segTree,i);
int mid = (segTree[i].l + segTree[i].r)>>1;
if(r <= mid){
update(segTree,i<<1,l,r,val);
}
else if(l>mid){
update(segTree,(i<<1)|1,l,r,val);
}
else{
update(segTree,i<<1,l,mid,val);
update(segTree,i<<1|1,mid+1,r,val);
}
push_up(segTree,i);
}
inline int query(Node segTree[],int i,int l,int r)//譟・隸「
{
if(segTree[i].l == l && segTree[i].r == r)
return segTree[i].sum;
push_down(segTree,i);
int mid = (segTree[i].l + segTree[i].r)>>1;
if(r <= mid){
return query(segTree,i<<1,l,r);
}
else if(l>mid){
return query(segTree,i<<1|1,l,r);
}
else {
return query(segTree,i<<1,l,mid);
return query(segTree,i<<1|1,mid+1,r);
}
}
inline void add2(Node segTree[],int u,int v,int val)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
{
int f1 = top[u], f2 = top[v];
int tmp = 0;
while(f1 != f2)
{
if(deep[f1] < deep[f2])
{
swap(f1,f2);
swap(u,v);
}
update(segTree,1,p[f1],p[u],val);
u = fa[f1]; f1 = top[u];
}
if(u == v){
return ;
}
if(deep[u] > deep[v]) swap(u,v);
update(segTree,1,p[son[u]],p[v],val);
}
int find(Node segTree[],int u,int v)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
{
int f1 = top[u], f2 = top[v];
int tmp = 0;
while(f1 != f2)
{
if(deep[f1] < deep[f2])
{
swap(f1,f2);
swap(u,v);
}
tmp = max(tmp,query(segTree,1,p[f1],p[u]));
u = fa[f1]; f1 = top[u];
}
if(u == v)return tmp;
if(deep[u] > deep[v]) swap(u,v);
return max(tmp,query(segTree,1,p[son[u]],p[v]));
}
int e[MAXN][2];
struct Re{
char s[10];
int u,v,k;
};
Re re[MAXN];
struct Re2{
int l,r,k;
};
Re2 re2[MAXN];
int ans[2][MAXN];
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int T;
int n,q;
scanf("%d",&T);
int _=0;
int i;
int u,v,pu,pv;
while(T--)
{
init();
scanf("%d%d",&n,&q);
for(i = 0;i < n-1;i++)
{
scanf("%d%d",&e[i][0],&e[i][1]);
addedge(e[i][0],e[i][1]);
addedge(e[i][1],e[i][0]);
}
addedge(n+1,1);
addedge(1,n+1);
dfs1(n+1,0,0);
getpos(n+1,n+1);
build(segTree1,1,0,pos-1);
build(segTree2,1,0,pos-1);
for(i=0;i<q;i++){
scanf("%s%d%d%d",re[i].s,&re[i].u,&re[i].v,&re[i].k);
if(re[i].s[3]=='2')add2(segTree2,re[i].u,re[i].v,re[i].k);
else add2(segTree1,fa[re[i].u],re[i].v,re[i].k);
}
//邂礼噪譏ッ霎ケ
for(i=0;i<n-1;i++){
u=e[i][0],v=e[i][1];
pu=p[u];
pv=p[v];
if(pu==v)ans[0][i]=query(segTree2,1,pu,pu);
else ans[0][i]=query(segTree2,1,pv,pv);
}
//邂礼噪譏ッ轤ケ
for(i=1;i<=n;i++)ans[1][i]=query(segTree1,1,p[i],p[i]);
printf("Case #%d:\n",++_);
for(i=1;i<=n;i++){
if(i!=1)printf(" ");
printf("%d",ans[1][i]);
}
puts("");
for(i=0;i<n-1;i++){
if(i)printf(" ");
printf("%d",ans[0][i]);
}
puts("");
}
return 0;
}
|
a.cc: In function 'void init()':
a.cc:31:9: error: 'pos' was not declared in this scope; did you mean 'pow'?
31 | pos = 0;
| ^~~
| pow
a.cc:32:16: error: 'son' was not declared in this scope; did you mean 'sin'?
32 | memset(son,-1,sizeof(son));
| ^~~
| sin
a.cc: In function 'void dfs1(int, int, int)':
a.cc:52:28: error: 'son' was not declared in this scope; did you mean 'sin'?
52 | if(son[u] == -1 || num[v] > num[son[u]])
| ^~~
| sin
a.cc: In function 'void getpos(int, int)':
a.cc:61:12: error: 'son' was not declared in this scope; did you mean 'sin'?
61 | if(son[u] != -1)
| ^~~
| sin
a.cc:63:24: error: 'pos' was not declared in this scope; did you mean 'pow'?
63 | p[u] = pos++;
| ^~~
| pow
a.cc:69:24: error: 'pos' was not declared in this scope; did you mean 'pow'?
69 | p[u] = pos++;
| ^~~
| pow
a.cc:76:25: error: 'son' was not declared in this scope; did you mean 'sin'?
76 | if(v != son[u] && v != fa[u])
| ^~~
| sin
a.cc: At global scope:
a.cc:82:1: error: expected unqualified-id before '{' token
82 | {
| ^
a.cc:86:2: error: 'segTree1' does not name a type
86 | }segTree1[MAXN<<2],segTree2[MAXN<<2];
| ^~~~~~~~
a.cc:87:13: error: variable or field 'build' declared void
87 | inline void build(Node segTree[],int i,int l,int r)
| ^~~~~
a.cc:87:19: error: 'Node' was not declared in this scope
87 | inline void build(Node segTree[],int i,int l,int r)
| ^~~~
a.cc:87:34: error: expected primary-expression before 'int'
87 | inline void build(Node segTree[],int i,int l,int r)
| ^~~
a.cc:87:40: error: expected primary-expression before 'int'
87 | inline void build(Node segTree[],int i,int l,int r)
| ^~~
a.cc:87:46: error: expected primary-expression before 'int'
87 | inline void build(Node segTree[],int i,int l,int r)
| ^~~
a.cc:99:13: error: variable or field 'push_up' declared void
99 | inline void push_up(Node segTree[],int i)
| ^~~~~~~
a.cc:99:21: error: 'Node' was not declared in this scope
99 | inline void push_up(Node segTree[],int i)
| ^~~~
a.cc:99:36: error: expected primary-expression before 'int'
99 | inline void push_up(Node segTree[],int i)
| ^~~
a.cc:104:13: error: variable or field 'push_down' declared void
104 | inline void push_down(Node segTree[],int i){
| ^~~~~~~~~
a.cc:104:23: error: 'Node' was not declared in this scope
104 | inline void push_down(Node segTree[],int i){
| ^~~~
a.cc:104:38: error: expected primary-expression before 'int'
104 | inline void push_down(Node segTree[],int i){
| ^~~
a.cc:114:13: error: variable or field 'update' declared void
114 | inline void update(Node segTree[],int i,int l,int r,int val)//譖エ譁ー蛹コ髣エ
| ^~~~~~
a.cc:114:20: error: 'Node' was not declared in this scope
114 | inline void update(Node segTree[],int i,int l,int r,int val)//譖エ譁ー蛹コ髣エ
| ^~~~
a.cc:114:35: error: expected primary-expression before 'int'
114 | inline void update(Node segTree[],int i,int l,int r,int val)//譖エ譁ー蛹コ髣エ
| ^~~
a.cc:114:41: error: expected primary-expression before 'int'
114 | inline void update(Node segTree[],int i,int l,int r,int val)//譖エ譁ー蛹コ髣エ
| ^~~
a.cc:114:47: error: expected primary-expression before 'int'
114 | inline void update(Node segTree[],int i,int l,int r,int val)//譖エ譁ー蛹コ髣エ
| ^~~
a.cc:114:53: error: expected primary-expression before 'int'
114 | inline void update(Node segTree[],int i,int l,int r,int val)//譖エ譁ー蛹コ髣エ
| ^~~
a.cc:137:18: error: 'Node' was not declared in this scope
137 | inline int query(Node segTree[],int i,int l,int r)//譟・隸「
| ^~~~
a.cc:137:33: error: expected primary-expression before 'int'
137 | inline int query(Node segTree[],int i,int l,int r)//譟・隸「
| ^~~
a.cc:137:39: error: expected primary-expression before 'int'
137 | inline int query(Node segTree[],int i,int l,int r)//譟・隸「
| ^~~
a.cc:137:45: error: expected primary-expression before 'int'
137 | inline int query(Node segTree[],int i,int l,int r)//譟・隸「
| ^~~
a.cc:137:50: error: expression list treated as compound expression in initializer [-fpermissive]
137 | inline int query(Node segTree[],int i,int l,int r)//譟・隸「
| ^
a.cc:155:13: error: variable or field 'add2' declared void
155 | inline void add2(Node segTree[],int u,int v,int val)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
| ^~~~
a.cc:155:18: error: 'Node' was not declared in this scope
155 | inline void add2(Node segTree[],int u,int v,int val)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
| ^~~~
a.cc:155:33: error: expected primary-expression before 'int'
155 | inline void add2(Node segTree[],int u,int v,int val)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
| ^~~
a.cc:155:39: error: expected primary-expression before 'int'
155 | inline void add2(Node segTree[],int u,int v,int val)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
| ^~~
a.cc:155:45: error: expected primary-expression before 'int'
155 | inline void add2(Node segTree[],int u,int v,int val)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
| ^~~
a.cc:176:10: error: 'Node' was not declared in this scope
176 | int find(Node segTree[],int u,int v)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
| ^~~~
a.cc:176:25: error: expected primary-expression before 'int'
176 | int find(Node segTree[],int u,int v)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
| ^~~
a.cc:176:31: error: expected primary-expression before 'int'
176 | int find(Node segTree[],int u,int v)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
| ^~~
a.cc:176:36: error: expression list treated as compound expression in initializer [-fpermissive]
176 | int find(Node segTree[],int u,int v)//譟・隸「u->v霎ケ逧?怙螟ァ蛟シ
| ^
a.cc: In function 'int main()':
a.cc:236:23: error: 'segTree1' was not declared in this scope
236 | build(segTree1,1,0,pos-1);
| ^~~~~~~~
a.cc:236:36: error: 'pos' was not declared in this scope; did you mean 'pow'?
236 | build(segTree1,1,0,pos-1);
| ^~~
| pow
a.cc:236:17: error: 'build' was not declared in this scope
236 | build(segTree1,1,0,pos-1);
| ^~~~~
a.cc:237:23: error: 'segTree2' was not declared in this scope
237 | build(segTree2,1,0,pos-1);
| ^~~~~~~~
a.cc:241:44: error: 'add2' was not declared in this scope
241 | if(re[i].s[3]=='2')add2(segTree2,re[i].u,re[i].v,re[i].k);
| ^~~~
a.cc:242:30: error: 'add2' was not declared in this scope
242 | else add2(segTree1,fa[re[i].u],re[i].v,re[i].k);
| ^~~~
a.cc:249:49: error: 'query' cannot be used as a function
249 | if(pu==v)ans[0][i]=query(segTree2,1,pu,pu);
| ~~~~~^~~~~~~~~~~~~~~~~~
a.cc:250:45: error: 'query' cannot be used as a function
250 | else ans[0][i]=query(segTree2,1,pv,pv);
| ~~~~~^~~~~~~~~~~~~~~~~~
a.cc:253:49: error: 'query' cannot be used as a function
253 | for(i=1;i<=n;i++)ans[1][i]=query(segTree1,1,p[i],p[i]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.