记录详情

Compile Error

foo.c: In function 'Init':
foo.c:5:17: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    5 |         int n = strlen(s);
      |                 ^~~~~~
foo.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | 
foo.c:5:17: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    5 |         int n = strlen(s);
      |                 ^~~~~~
foo.c:5:17: note: include '<string.h>' or provide a declaration of 'strlen'
foo.c: In function 'Add':
foo.c:42:15: error: 'i' undeclared (first use in this function)
   42 |         for(; i<n1; i++)
      |               ^
foo.c:42:15: note: each undeclared identifier is reported only once for each function it appears in
foo.c: In function 'main':
foo.c:62:18: error: 's' undeclared (first use in this function)
   62 |         n = Init(s, d);
      |                  ^
foo.c:62:21: error: 'd' undeclared (first use in this function)
   62 |         n = Init(s, d);
      |                     ^
foo.c:64:9: warning: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   64 |         scanf_s("%d %d",  &y,&x);//y的x次阶乘
      |         ^~~~~~~
      |         scanf
foo.c: At top level:
foo.c:76:9: warning: data definition has no type or storage class
   76 |         len1=Init(s1, d1);
      |         ^~~~
foo.c:76:9: warning: type defaults to 'int' in declaration of 'len1' [-Wimplicit-int]
foo.c:76:14: error: initializer element is not constant
   76 |         len1=Init(s1, d1);
      |              ^~~~
foo.c:77:9: warning: data definition has no type or storage class
   77 |         len2=Init(s2, d2);
      |         ^~~~
foo.c:77:9: warning: type defaults to 'int' in declaration of 'len2' [-Wimplicit-int]
foo.c:77:14: error: initializer element is not constant
   77 |         len2=Init(s2, d2);
      |              ^~~~
foo.c:80:15: error: expected declaration specifiers or '...' before string constant
   80 |         scanf("%d %d",&x1,&n1);
      |               ^~~~~~~
foo.c:80:23: error: expected declaration specifiers or '...' before '&' token
   80 |         scanf("%d %d",&x1,&n1);
      |                       ^
foo.c:80:27: error: expected declaration specifiers or '...' before '&' token
   80 |         scanf("%d %d",&x1,&n1);
      |                           ^
foo.c:81:15: error: expected declaration specifiers or '...' before string constant
   81 |         scanf("%d %d",&x2,&n2);
      |               ^~~~~~~
foo.c:81:23: error: expected declaration specifiers or '...' before '&' token
   81 |         scanf("%d %d",&x2,&n2);
      |                       ^
foo.c:81:27: error: expected declaration specifiers or '...' before '&' token
   81 |         scanf("%d %d",&x2,&n2);
      |                           ^
foo.c:82:1: error: expected identifier or '(' before 'for'
   82 | for (int i = 1; i <= n1; i++) {
      | ^~~
foo.c:82:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   82 | for (int i = 1; i <= n1; i++) {
      |                   ^~
foo.c:82:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   82 | for (int i = 1; i <= n1; i++) {
      |                           ^~
foo.c:85:1: error: expected identifier or '(' before 'for'
   85 | for (int i = 1; i <= n2; i++) {
      | ^~~
foo.c:85:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   85 | for (int i = 1; i <= n2; i++) {
      |                   ^~
foo.c:85:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   85 | for (int i = 1; i <= n2; i++) {
      |                           ^~
foo.c:89:9: warning: data definition has no type or storage class
   89 |         len3=Add(d1,len1, d2,len2, d3);
      |         ^~~~
foo.c:89:9: warning: type defaults to 'int' in declaration of 'len3' [-Wimplicit-int]
foo.c:89:14: error: initializer element is not constant
   89 |         len3=Add(d1,len1, d2,len2, d3);
      |              ^~~
foo.c:90:9: warning: data definition has no type or storage class
   90 |         Output(d3, len3);
      |         ^~~~~~
foo.c:90:9: warning: type defaults to 'int' in declaration of 'Output' [-Wimplicit-int]
foo.c:90:9: warning: parameter names (without types) in function declaration
foo.c:90:9: error: conflicting types for 'Output'; have 'int()'
foo.c:13:6: note: previous definition of 'Output' with type 'void(int *, int)'
   13 | void Output(int d[],int n) {
      |      ^~~~~~
foo.c:91:9: error: expected identifier or '(' before 'return'
   91 |         return 0;
      |         ^~~~~~
foo.c:92:1: error: expected identifier or '(' before '}' token
   92 | }
      | ^
foo.c: In function 'Add':
foo.c:56:1: warning: control reaches end of non-void function [-Wreturn-type]
   56 | }
      | ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
A11-3 高精度整数的加法
语言
C
递交时间
2023-11-11 16:18:49
评测时间
2023-11-11 16:18:49
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes