#2392
SumaXL
Se dau două numere, unul mare și unul mic, ambele pozitive. Calculați suma lor.
Problema | SumaXL | Operații I/O |
sumaxl.in /sumaxl.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53481767 | Utilizator | |
Fișier | sumaxl.cpp | Dimensiune | 848 B |
Data încărcării | 02 Noiembrie 2024, 10:07 | Scor / rezultat | Eroare de compilare |
sumaxl.cpp:6:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("sumaxl.in") ^ sumaxl.cpp:7:1: error: expected ',' or ';' before 'ofstream' ofstream cout("sumaxl.out") ^ sumaxl.cpp: In function 'int main()': sumaxl.cpp:11:5: error: reference to 'cin' is ambiguous cin>>n; ^ sumaxl.cpp:6:10: note: candidates are: <typeprefixerror>cin ifstream cin("sumaxl.in") ^ In file included from sumaxl.cpp:4:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ sumaxl.cpp:11:10: error: 'n' was not declared in this scope cin>>n; ^ sumaxl.cpp:12:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ sumaxl.cpp:14:9: error: reference to 'cin' is ambiguous cin>>a; ^ sumaxl.cpp:6:10: note: candidates are: <typeprefixerror>cin ifstream cin("sumaxl.in") ^ In file included from sumaxl.cpp:4:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ sumaxl.cpp:14:14: error: 'a' was not declared in this scope cin>>a; ^ sumaxl.cpp:15:9: error: 'v1' was not declared in this scope v1[n-i+1]=a; ^ sumaxl.cpp:17:5: error: reference to 'cin' is ambiguous cin>>x; ^ sumaxl.cpp:6:10: note: candidates are: <typeprefixerror>cin ifstream cin("sumaxl.in") ^ In file included from sumaxl.cpp:4:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ sumaxl.cpp:17:10: error: 'x' was not declared in this scope cin>>x; ^ sumaxl.cpp:18:5: error: 'cx' was not declared in this scope cx=x; ^ sumaxl.cpp:21:9: error: 'nr' was not declared in this scope nr++; ^ sumaxl.cpp:24:5: error: 'g' was not declared in this scope g=0; ^ sumaxl.cpp:27:9: error: 'v2' was not declared in this scope v2[++g]=x%10; ^ sumaxl.cpp:30:5: error: 't' was not declared in this scope t=0; ^ sumaxl.cpp:31:9: error: 'i' was not declared in this scope for(i=1; i<=max(nr, n)+1; i++) ^ sumaxl.cpp:31:21: error: 'nr' was not declared in this scope for(i=1; i<=max(nr, n)+1; i++) ^ sumaxl.cpp:33:9: error: 'v3' was not declared in this scope v3[i]=v1[i]+v2[i]+t; ^ sumaxl.cpp:33:15: error: 'v1' was not declared in this scope v3[i]=v1[i]+v2[i]+t; ^ sumaxl.cpp:33:21: error: 'v2' was not declared in this scope v3[i]=v1[i]+v2[i]+t; ^ sumaxl.cpp:38:8: error: 'v3' was not declared in this scope if(v3[max(nr, n)+1]!=0) ^ sumaxl.cpp:38:15: error: 'nr' was not declared in this scope if(v3[max(nr, n)+1]!=0) ^ sumaxl.cpp:39:13: error: 'i' was not declared in this scope for(i=max(nr, n)+1; i>=1; i--) ^ sumaxl.cpp:41:14: error: 'i' was not declared in this scope else for(i=max(nr, n); i>=1; i--) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumaXL 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ă.