#2641
AF
Gigel are ca temă la matematică să precizeze valoarea de adevăr a unor expresii de forma nr1 semn nr2 = nr3
, unde nr1
, nr2
și nr3
sunt numere naturale, iar semn
poate fi +
, -
, x
sau :
reprezintând adunarea, scăderea, înmulțirea și împărțirea. Ajutați-l pe Gigel să rezolve tema la matematică.
-
Problema | AF | Operații I/O |
af.in /af.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51319624 | Utilizator | |
Fișier | af.c | Dimensiune | 556 B |
Data încărcării | 06 Iunie 2024, 19:22 | Scor / rezultat | Eroare de compilare |
af.c: In function 'main': af.c:9:26: warning: statement with no effect [-Wunused-value] case '+': if(a+b==c) ok==1; ^ af.c:11:25: warning: statement with no effect [-Wunused-value] case'-': if(a-b==c) ok==1; ^ af.c:13:25: warning: statement with no effect [-Wunused-value] case '*':if(a*b==c) ok==1; ^ af.c:15:25: warning: statement with no effect [-Wunused-value] case ':':if(a/b==c) ok==1; ^ af.c:7:27: warning: unused variable 'n' [-Wunused-variable] long long int a,b,c,i,n; ^ af.c:7:25: warning: unused variable 'i' [-Wunused-variable] long long int a,b,c,i,n; ^ af.c:5:15: warning: unused variable 'egal' [-Wunused-variable] char semn,egal; ^ af.c:3:11: warning: unused variable 'f' [-Wunused-variable] FILE *f=fopen("af.in","r"); ^ af.c: At top level: af.c:24:5: warning: data definition has no type or storage class [enabled by default] fclose(f); ^ af.c:24:5: warning: type defaults to 'int' in declaration of 'fclose' [enabled by default] af.c:24:5: warning: parameter names (without types) in function declaration [enabled by default] af.c:25:5: warning: data definition has no type or storage class [enabled by default] fclose(g); ^ af.c:25:5: warning: type defaults to 'int' in declaration of 'fclose' [enabled by default] af.c:25:5: warning: parameter names (without types) in function declaration [enabled by default] af.c:26:2: error: expected identifier or '(' before 'return' return 0; ^ af.c:27:1: error: expected identifier or '(' before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema AF face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.