#3217
Trepte2.2
O persoana are de urcat n
trepte. Ştiind că de pe treapta i
poate trece pe treapta i + 1, i + 2, ..., i + (k - 1)
sau i + k
, aflaţi în câte moduri poate urca cele n
trepte. (inițial este pe treapta 1
)
Problema | Trepte2.2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 4 MB
/
Stivă 0.2 MB
|
Id soluție | #48785808 | Utilizator | |
Fișier | trepte2.2.cpp | Dimensiune | 936 B |
Data încărcării | 05 Februarie 2024, 16:52 | Scor / rezultat | Eroare de compilare |
trepte2.2.cpp: In function 'int main()': trepte2.2.cpp:18:13: error: 'B' was not declared in this scope B[i][j]=A[i][j]+B[i][j+1]; ^ trepte2.2.cpp:18:21: error: 'A' was not declared in this scope B[i][j]=A[i][j]+B[i][j+1]; ^ trepte2.2.cpp:20:17: error: 'B' was not declared in this scope B[i][j]=A[i][j]+B[i+1][j+1]; ^ trepte2.2.cpp:20:25: error: 'A' was not declared in this scope B[i][j]=A[i][j]+B[i+1][j+1]; ^ trepte2.2.cpp:21:16: error: 'B' was not declared in this scope if(B[i+1][j<=B[i+1][j+1]) ^ trepte2.2.cpp:21:37: error: expected ']' before ')' token if(B[i+1][j<=B[i+1][j+1]) ^ trepte2.2.cpp:23:25: error: 'A' was not declared in this scope B[i][j]=A[i][j]+B[i+1][j+1]; ^ trepte2.2.cpp:24:17: error: 'T' was not declared in this scope T[i][j]=j; ^ trepte2.2.cpp:26:19: error: 'B' was not declared in this scope fout<<B[1][1]<<'\n'; ^ trepte2.2.cpp:31:23: error: 'A' was not declared in this scope fout<<A[i][j]<<' '; ^ trepte2.2.cpp:32:19: error: 'T' was not declared in this scope j=T[i][j]; ^ trepte2.2.cpp:8:33: warning: unused variable 't' [-Wunused-variable] int a[101][101],b[101][101],t[101][101],n; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Trepte2.2 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ă.