#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 | #51571243 | Utilizator | |
Fișier | sum.cpp | Dimensiune | 6.99 KB |
Data încărcării | 13 Iulie 2024, 16:27 | Scor / rezultat | Eroare de compilare |
sum.cpp:40:5: error: redefinition of 'int i' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:13:7: error: 'int i' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:40:42: error: redefinition of 'int n' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:13:5: error: 'int n' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:40:48: error: redefinition of 'int x' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:13:9: error: 'int x' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:40:50: error: redefinition of 'int m' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:13:23: error: 'int m' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:40:52: error: redefinition of 'int st' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:13:25: error: 'int st' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:40:55: error: redefinition of 'int dr' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:13:28: error: 'int dr' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:40:58: error: redefinition of 'int mij' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:13:31: error: 'int mij' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:40:70: error: conflicting declaration 'int v [200001]' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:13:11: error: 'v' has a previous declaration as 'int v [25002]' int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp: In function 'int main()': sum.cpp:41:5: error: redefinition of 'int main()' int main() ^ sum.cpp:14:5: error: 'int main()' previously defined here int main(){ ^ sum.cpp: At global scope: sum.cpp:83:13: error: conflicting declaration 'int a [200000]' int a[200000]; ^ sum.cpp:40:9: error: 'a' has a previous declaration as 'int a [100001]' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:84:13: error: conflicting declaration 'int b [200000]' int b[200000]; ^ sum.cpp:40:19: error: 'b' has a previous declaration as 'int b [100001]' int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp: In function 'int main()': sum.cpp:85:5: error: redefinition of 'int main()' int main() ^ sum.cpp:14:5: error: 'int main()' previously defined here int main(){ ^ sum.cpp: At global scope: sum.cpp:229:5: error: redefinition of 'int i' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:13:7: error: 'int i' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:229:7: error: redefinition of 'int j' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:7: error: 'int j' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:229:17: error: redefinition of 'int a [100001]' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:9: error: 'int a [100001]' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:229:27: error: redefinition of 'int b [100001]' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:19: error: 'int b [100001]' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:229:37: error: redefinition of 'int c [200002]' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:29: error: 'int c [200002]' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:229:39: error: redefinition of 'int lg' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:39: error: 'int lg' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:229:42: error: redefinition of 'int n' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:13:5: error: 'int n' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:229:44: error: redefinition of 'int m' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:13:23: error: 'int m' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp: In function 'int main()': sum.cpp:230:5: error: redefinition of 'int main()' int main() ^ sum.cpp:14:5: error: 'int main()' previously defined here int main(){ ^ sum.cpp: At global scope: sum.cpp:302:13: error: redefinition of 'std::ifstream fin' ifstream fin("interclasare.in"); ^ sum.cpp:227:10: error: 'std::ifstream fin' previously declared here ifstream fin("interclasare1.in"); ^ sum.cpp:303:14: error: redefinition of 'std::ofstream fout' ofstream fout("interclasare.out"); ^ sum.cpp:228:10: error: 'std::ofstream fout' previously declared here ofstream fout("interclasare1.out"); ^ sum.cpp:304:5: error: redefinition of 'int i' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:13:7: error: 'int i' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:304:7: error: redefinition of 'int j' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:7: error: 'int j' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:304:17: error: redefinition of 'int a [100001]' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:9: error: 'int a [100001]' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:304:27: error: redefinition of 'int b [100001]' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:19: error: 'int b [100001]' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:304:37: error: redefinition of 'int c [200002]' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:29: error: 'int c [200002]' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:304:39: error: redefinition of 'int lg' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:40:39: error: 'int lg' previously declared here int i,j,a[100001],b[100001],c[200002],lg,n,poz,x,m,st,dr,mij,v[200001]; ^ sum.cpp:304:42: error: redefinition of 'int n' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:13:5: error: 'int n' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp:304:44: error: redefinition of 'int m' int i,j,a[100001],b[100001],c[200002],lg,n,m; ^ sum.cpp:13:23: error: 'int m' previously declared here int n,i,x,v[25002],ok,m,st,dr,mij; ^ sum.cpp: In function 'int main()': sum.cpp:305:5: error: redefinition of 'int main()' int main() ^ sum.cpp:14:5: error: 'int main()' previously defined here int main(){ ^
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ă.