#1
sum
Să se scrie un program care citeşte din fişier două numere întregi şi determină suma lor.
Problema | sum | Operații I/O |
sum.in /sum.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #38263802 | Utilizator | |
Fișier | sum.cpp | Dimensiune | 2.08 KB |
Data încărcării | 05 Octombrie 2022, 11:27 | Scor / rezultat | Eroare de compilare |
sum.cpp: In function 'void citire(int&, int*)': sum.cpp:7:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ sum.cpp: In function 'void afisare(int, int*)': sum.cpp:12:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ sum.cpp: In function 'void sort_select(int, int*)': sum.cpp:18:9: error: 'i' was not declared in this scope for(i=1;i<n;i++) ^ sum.cpp:19:10: error: 'j' was not declared in this scope for(j=i+1;j<=n;j++) ^ sum.cpp: At global scope: sum.cpp:23:27: error: expected ',' or '...' before 'v' void sort_bubble(int nint v[]) ^ sum.cpp: In function 'void sort_bubble(int)': sum.cpp:28:15: error: 'n' was not declared in this scope for(i=1;i<n;i++) ^ sum.cpp:29:8: error: 'v' was not declared in this scope if(v[i]<v[i+1]) ^ sum.cpp:31:21: error: 'j' was not declared in this scope swap(v[i],v[j]); ^ sum.cpp:36:1: error: expected ';' before '}' token } ^ sum.cpp: In function 'void caut_binara(int, int*, int)': sum.cpp:45:13: error: return-statement with a value, in function returning 'void' [-fpermissive] return 1; ^ sum.cpp:54:12: error: return-statement with a value, in function returning 'void' [-fpermissive] return 0; ^ sum.cpp: In function 'void stergere_elem(int&, int*)': sum.cpp:71:22: error: 'palindrom' was not declared in this scope if(palindrom(v[i])==1)//proprietatea ceruta ^ sum.cpp: In function 'int pp(int)': sum.cpp:82:13: error: 'sqrt' was not declared in this scope r=sqrt(x); ^ sum.cpp:85:5: error: 'else' without a previous 'if' else ^ sum.cpp: In function 'void inserare(int&, int*)': sum.cpp:93:9: error: expected ')' before '{' token { ^ sum.cpp:100:1: error: expected primary-expression before '}' token } ^ sum.cpp:100:1: error: expected ';' before '}' token sum.cpp:90:11: warning: unused variable 'j' [-Wunused-variable] int i,j; ^ sum.cpp: In function 'void secventa(int, int*)': sum.cpp:104:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ sum.cpp: In function 'int main()': sum.cpp:121:5: error: expected ';' before 'return' return 0; ^ sum.cpp:121:13: warning: statement is a reference, not call, to function 'citire' [-Waddress] return 0; ^ sum.cpp:121:13: warning: statement has no effect [-Wunused-value]
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sum 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ă.