#3994
PartitiiNumar5
Se dă un număr natural n
. Determinați, în ordine lexicografică, toate modalitățile de a-l scrie pe n
ca sumă de numere naturale pare.
Problema | PartitiiNumar5 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55005364 | Utilizator | |
Fișier | partitiinumar5.cpp | Dimensiune | 480 B |
Data încărcării | 16 Decembrie 2024, 10:30 | Scor / rezultat | Eroare de compilare |
partitiinumar5.cpp:5:1: error: stray '\342' in program { for(int i =1 ; i <= k ; i ++) cout << v[i] << “ “; cout << endl; ^ partitiinumar5.cpp:5:1: error: stray '\200' in program partitiinumar5.cpp:5:1: error: stray '\234' in program partitiinumar5.cpp:5:1: error: stray '\342' in program partitiinumar5.cpp:5:1: error: stray '\200' in program partitiinumar5.cpp:5:1: error: stray '\234' in program partitiinumar5.cpp:9:72: error: stray '\342' in program else Back(k + 1 , S + v[k]); } } } int main() { cin >> n; v0 = 2; Back(1 , 0); if(cnt == 0) cout << “imposibil\n”; r ^ partitiinumar5.cpp:9:72: error: stray '\200' in program partitiinumar5.cpp:9:72: error: stray '\234' in program partitiinumar5.cpp:9:72: error: stray '\' in program partitiinumar5.cpp:9:72: error: stray '\342' in program partitiinumar5.cpp:9:72: error: stray '\200' in program partitiinumar5.cpp:9:72: error: stray '\235' in program partitiinumar5.cpp: In function 'void afis(int)': partitiinumar5.cpp:5:41: error: 'v' was not declared in this scope { for(int i =1 ; i <= k ; i ++) cout << v[i] << “ “; cout << endl; ^ partitiinumar5.cpp:5:56: error: expected primary-expression before ';' token { for(int i =1 ; i <= k ; i ++) cout << v[i] << “ “; cout << endl; ^ partitiinumar5.cpp: In function 'void Back(int, int)': partitiinumar5.cpp:8:15: error: 'v' was not declared in this scope { for(int i = v[k-1] ; i <= n ; i += 2) { v[k] = i; if(S + v[k] <= n) { if(S + v[k] == n) afis(k), cnt ++; ^ partitiinumar5.cpp: In function 'int main()': partitiinumar5.cpp:9:130: error: 'v0' was not declared in this scope else Back(k + 1 , S + v[k]); } } } int main() { cin >> n; v0 = 2; Back(1 , 0); if(cnt == 0) cout << “imposibil\n”; r ^ partitiinumar5.cpp:9:175: error: 'imposibil' was not declared in this scope else Back(k + 1 , S + v[k]); } } } int main() { cin >> n; v0 = 2; Back(1 , 0); if(cnt == 0) cout << “imposibil\n”; r ^ partitiinumar5.cpp:9:185: error: expected ';' before 'n' else Back(k + 1 , S + v[k]); } } } int main() { cin >> n; v0 = 2; Back(1 , 0); if(cnt == 0) cout << “imposibil\n”; r ^ partitiinumar5.cpp:9:191: error: 'r' was not declared in this scope else Back(k + 1 , S + v[k]); } } } int main() { cin >> n; v0 = 2; Back(1 , 0); if(cnt == 0) cout << “imposibil\n”; r ^ partitiinumar5.cpp:9:191: error: expected ';' at end of input partitiinumar5.cpp:9:191: error: expected '}' at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PartitiiNumar5 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ă.