#1798
Trepte
C++
O persoana are de urcat n
trepte. Aflaţi in câte moduri poate urca cele n
trepte.
Problema | Trepte | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #29776909 | Utilizator | |
Fișier | trepte.cpp | Dimensiune | 313 B |
Data încărcării | 21 Mai 2021, 08:40 | Scor / rezultat | Eroare de compilare |
trepte.cpp:8:27: error: conflicting declaration 'int f [31]' int n,a[101][101],i,j,f[31]; ^ trepte.cpp:5:10: error: 'f' has a previous declaration as 'std::ifstream f' ifstream f("sumtri.in"); ^ trepte.cpp: In function 'int main()': trepte.cpp:13:6: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[1]=1; ^ trepte.cpp:14:6: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[2]=2; ^ trepte.cpp:16:10: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[i]=f[i-1]+f[i-1]; ^ trepte.cpp:16:15: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[i]=f[i-1]+f[i-1]; ^ trepte.cpp:16:22: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') f[i]=f[i-1]+f[i-1]; ^ trepte.cpp:18:12: error: no match for 'operator[]' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'int') cout<<f[n]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Trepte 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ă.