Borderou de evaluare (job #791588)
| Utilizator |
|
IP | ascuns |
|---|---|---|---|
| Problemă | Centru Prim (clasa a 5-a) | Compilator | c-32 |
| Rundă | Arhiva de probleme | Status | evaluat |
| Dată | 27 oct. 2024 19:40:10 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.c:7:1: warning: data definition has no type or storage class
7 | fin = fopen("centruprim.in","r");
| ^~~
main.c:7:1: warning: type defaults to 'int' in declaration of 'fin' [-Wimplicit-int]
main.c:7:1: error: conflicting types for 'fin'; have 'int'
main.c:5:7: note: previous declaration of 'fin' with type 'FILE *'
5 | FILE *fin,*fout;
| ^~~
main.c:8:12: error: expected ')' before string constant
8 | fscanf(fin, "%d ",&n);
| ^~~~~~
| )
main.c:9:1: warning: data definition has no type or storage class
9 | fclose( fin );
| ^~~~~~
main.c:9:1: warning: type defaults to 'int' in declaration of 'fclose' [-Wimplicit-int]
main.c:9:1: warning: parameter names (without types) in function declaration
main.c:10:1: warning: data definition has no type or storage class
10 | n = n / 10;
| ^
main.c:10:1: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:10:5: error: initializer element is not constant
10 | n = n / 10;
| ^
main.c:11:1: warning: data definition has no type or storage class
11 | n2 = 0;
| ^~
main.c:11:1: warning: type defaults to 'int' in declaration of 'n2' [-Wimplicit-int]
main.c:12:1: warning: data definition has no type or storage class
12 | Name = 1;
| ^~~~
main.c:12:1: warning: type defaults to 'int' in declaration of 'Name' [-Wimplicit-int]
main.c:13:1: error: expected identifier or '(' before 'while'
13 | while(n > 9){
| ^~~~~
main.c:18:1: warning: data definition has no type or storage class
18 | d = 2
| ^
main.c:18:1: warning: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:19:1: error: expected ',' or ';' before 'while'
19 | while(d * d <= n && n % d > 0){
| ^~~~~
main.c:22:1: warning: data definition has no type or storage class
22 | fout = fopen("centruprim.out","w");
| ^~~~
main.c:22:1: warning: type defaults to 'int' in declaration of 'fout' [-Wimplicit-int]
main.c:22:1: error: conflicting types for 'fout'; have 'int'
main.c:5:12: note: previous declaration of 'fout' with type 'FILE *'
5 | FILE *fin,*fout;
| ^~~~