#235
GenMat18
Scrieţi un program care citeşte de la tastatură un număr natural n
şi construieşte în memorie o matrice cu n
linii şi n
coloane ale cărei elemente sunt termeni ai şirului Fibonacci, dispuşi într-o ordine precizată.
Variante Bacalaureat 2009
Problema | GenMat18 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54782018 | Utilizator | |
Fișier | genmat18.cpp | Dimensiune | 502 B |
Data încărcării | 08 Decembrie 2024, 17:18 | Scor / rezultat | Eroare de compilare |
genmat18.cpp:3:18: error: expected initializer before 'x' int n,a[100][100]x=1,y=1,z,i,j; ^ genmat18.cpp: In function 'int main()': genmat18.cpp:6:9: error: 'j' was not declared in this scope for(j=3;j<=n;j++) ^ genmat18.cpp:7:6: error: 'a' was not declared in this scope {a[1][j] = z = x+y; ^ genmat18.cpp:7:16: error: 'z' was not declared in this scope {a[1][j] = z = x+y; ^ genmat18.cpp:7:20: error: 'x' was not declared in this scope {a[1][j] = z = x+y; ^ genmat18.cpp:7:22: error: 'y' was not declared in this scope {a[1][j] = z = x+y; ^ genmat18.cpp:11:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ genmat18.cpp:12:13: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ genmat18.cpp:14:7: error: 'a' was not declared in this scope a[i][j] = z = x+y; ^ genmat18.cpp:14:17: error: 'z' was not declared in this scope a[i][j] = z = x+y; ^ genmat18.cpp:14:21: error: 'x' was not declared in this scope a[i][j] = z = x+y; ^ genmat18.cpp:14:23: error: 'y' was not declared in this scope a[i][j] = z = x+y; ^ genmat18.cpp:15:18: error: 'a' was not declared in this scope else a[i][n-j+1] = z = x+y; ^ genmat18.cpp:15:32: error: 'z' was not declared in this scope else a[i][n-j+1] = z = x+y; ^ genmat18.cpp:15:36: error: 'x' was not declared in this scope else a[i][n-j+1] = z = x+y; ^ genmat18.cpp:15:38: error: 'y' was not declared in this scope else a[i][n-j+1] = z = x+y; ^ genmat18.cpp:16:13: error: 'x' was not declared in this scope x = y; ^ genmat18.cpp:16:17: error: 'y' was not declared in this scope x = y; ^ genmat18.cpp:17:17: error: 'z' was not declared in this scope y = z; ^ genmat18.cpp:19:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++){ ^ genmat18.cpp:20:13: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ genmat18.cpp:21:21: error: 'a' was not declared in this scope cout << a[i][j] << " "; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat18 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ă.