#37
ZeroFact
C++
Scrieți definiția completă a unui subprogram C++, nz
, cu un parametru întreg n
, care returnează numărul zerourilor de la sfârşitul numărului n!
Variante Bacalaureat 2009
Problema | ZeroFact | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50041651 | Utilizator | |
Fișier | zerofact.cpp | Dimensiune | 4.42 KB |
Data încărcării | 25 Martie 2024, 11:02 | Scor / rezultat | Eroare de compilare |
zerofact.cpp:89:31: error: 'std::vector' has not been declared int rec_5 (int exponent, std::vector<int>& memoization_5, std::vector<int>& lengths_5) { ^ zerofact.cpp:89:37: error: expected ',' or '...' before '<' token int rec_5 (int exponent, std::vector<int>& memoization_5, std::vector<int>& lengths_5) { ^ zerofact.cpp: In function 'int rec_5(int, int)': zerofact.cpp:91:3: error: 'memoization_5' was not declared in this scope memoization_5.push_back(0); ^ zerofact.cpp:92:3: error: 'lengths_5' was not declared in this scope lengths_5.push_back(0); ^ zerofact.cpp:97:3: error: 'memoization_5' was not declared in this scope memoization_5.push_back(3); ^ zerofact.cpp:98:3: error: 'lengths_5' was not declared in this scope lengths_5.push_back(3); ^ zerofact.cpp:104:45: error: 'lengths_5' was not declared in this scope int current_5_to_exp_1 = current_length - lengths_5[lengths_5.size() - 1]; ^ zerofact.cpp:106:3: error: 'memoization_5' was not declared in this scope memoization_5.push_back(current_5_to_exp_1); ^ zerofact.cpp:111:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (size_t index = 0; index < exponent; index++) { ^ zerofact.cpp: At global scope: zerofact.cpp:119:40: error: 'std::vector' has not been declared void recursion_for_5 (int number, std::vector<int>& memoization_5, std::vector<int>& lengths_5, int& count_5) { ^ zerofact.cpp:119:46: error: expected ',' or '...' before '<' token void recursion_for_5 (int number, std::vector<int>& memoization_5, std::vector<int>& lengths_5, int& count_5) { ^ zerofact.cpp: In function 'void recursion_for_5(int, int)': zerofact.cpp:124:3: error: 'count_5' was not declared in this scope count_5 += rec_5(exponent, memoization_5, lengths_5); ^ zerofact.cpp:124:30: error: 'memoization_5' was not declared in this scope count_5 += rec_5(exponent, memoization_5, lengths_5); ^ zerofact.cpp:124:45: error: 'lengths_5' was not declared in this scope count_5 += rec_5(exponent, memoization_5, lengths_5); ^ zerofact.cpp: In function 'int algorithm_1(int)': zerofact.cpp:158:2: error: 'vector' is not a member of 'std' std::vector<int> memoization_5; ^ zerofact.cpp:158:14: error: expected primary-expression before 'int' std::vector<int> memoization_5; ^ zerofact.cpp:158:14: error: expected ';' before 'int' zerofact.cpp:159:2: error: 'vector' is not a member of 'std' std::vector<int> lengths_5; ^ zerofact.cpp:159:14: error: expected primary-expression before 'int' std::vector<int> lengths_5; ^ zerofact.cpp:159:14: error: expected ';' before 'int' zerofact.cpp:174:27: error: 'memoization_5' was not declared in this scope recursion_for_5(number, memoization_5, lengths_5, count_5); ^ zerofact.cpp:174:42: error: 'lengths_5' was not declared in this scope recursion_for_5(number, memoization_5, lengths_5, count_5); ^ zerofact.cpp: In function 'void variant_0()': zerofact.cpp:29:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &number); ^ zerofact.cpp: In function 'void variant_1()': zerofact.cpp:186:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &number); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ZeroFact face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.