Borderou de evaluare (job #654799)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Petale (clasa 7-8) | Compilator | c-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 8 iul. 2022 10:41:05 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.c: In function 'main':
main.c:7:13: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[201]' [-Wformat=]
7 | scanf("%s", &s);
| ~^ ~~
| | |
| | char (*)[201]
| char *
main.c:9:7: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
9 | n=strlen(s);
| ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strlen'
2 | #include <stdlib.h>
+++ |+#include <string.h>
3 |
main.c:9:7: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
9 | n=strlen(s);
| ^~~~~~
main.c:9:7: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:12:25: error: expected ')' before ';' token
12 | for(i=n-1; i>=0; i--; p3=(p3*3)%7)
| ~ ^
| )
main.c:14:24: error: expected ';' before 'else'
14 | if(s[i]=='x') px=p3
| ^
| ;
15 | else rest=(rest + p3*(s[i]-'0'));
| ~~~~
main.c:21:21: error: expected ';' before 'return'
21 | printf("%d", x)
| ^
| ;
22 |
23 | return 0;
| ~~~~~~
main.c:7:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
7 | scanf("%s", &s);
| ^~~~~~~~~~~~~~~