#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 | #34880306 | Utilizator | |
Fișier | sum.cpp | Dimensiune | 1.05 KB |
Data încărcării | 16 Februarie 2022, 21:36 | Scor / rezultat | Eroare de compilare |
sum.cpp: In function 'void BFS(int)': sum.cpp:14:18: error: 'n' was not declared in this scope for (i=1; i<=n; i++) ^ sum.cpp:15:9: error: 'coada' was not declared in this scope coada[1]=x; ^ sum.cpp:16:9: error: 'viz' was not declared in this scope viz[x]=1; ^ sum.cpp:20:12: error: 'coada' was not declared in this scope vf=coada[prec++]; ^ sum.cpp:22:22: error: 'n' was not declared in this scope for (i=1; i<=n; i++) ^ sum.cpp:23:17: error: 'A' was not declared in this scope if (A[vf][i]==1 && viz[i]==0)///x si i sunt adiacente/i vecin cu x ^ sum.cpp:32:9: error: 'fout' was not declared in this scope fout<<coada[i]<<' '; ^ sum.cpp:32:15: error: 'coada' was not declared in this scope fout<<coada[i]<<' '; ^ sum.cpp: In function 'void DFS(int)': sum.cpp:38:5: error: 'fout' was not declared in this scope fout<<x<<' '; ^ sum.cpp:39:5: error: 'viz' was not declared in this scope viz[x]=1; ^ sum.cpp:41:20: error: 'n' was not declared in this scope for(int i=0;i<=n;i++) ^ sum.cpp:42:12: error: 'A' was not declared in this scope if(A[x][i]&& !viz[i]) ///i este vecin cu x si i nevizitat ^ sum.cpp: In function 'void roywarshall()': sum.cpp:49:17: error: 'n' was not declared in this scope for(k=1; k<=n; k++) ^ sum.cpp:52:20: error: 'a' was not declared in this scope if(a[i][k]&&a[k][j]) ^
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ă.