#228
GenMat15
Scrieţi un program care citeşte de la tastatură două numere naturale n
şi m
şi construieşte în memorie o matrice cu n
linii şi m
coloane care conţine numerele naturale de la 1
la m*n
, dispuse astfel:
1
la m
, ordonate crescător;m+1
la 2*m
, ordonate descrescător;2*m+1
la 3*m
, ordonate crescător;3*m+1
la 4*m
, ordonate descrescător;Variante Bacalaureat 2009
Problema | GenMat15 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #31649000 | Utilizator | |
Fișier | genmat15.cpp | Dimensiune | 713 B |
Data încărcării | 19 Octombrie 2021, 17:51 | Scor / rezultat | Eroare de compilare |
genmat15.cpp:6:11: error: two or more data types in declaration of 's' char s[257],c[257],t[257]; ^ genmat15.cpp:6:18: error: two or more data types in declaration of 'c' char s[257],c[257],t[257]; ^ genmat15.cpp:6:25: error: two or more data types in declaration of 't' char s[257],c[257],t[257]; ^ genmat15.cpp: In function 'int main()': genmat15.cpp:9:10: error: 's' was not declared in this scope cin>>s>>c; ^ genmat15.cpp:9:13: error: 'c' was not declared in this scope cin>>s>>c; ^ genmat15.cpp:14:13: error: 'i' was not declared in this scope for(i=1; i<strlen(c)i++) ^ genmat15.cpp:14:29: error: expected ';' before 'i' for(i=1; i<strlen(c)i++) ^ genmat15.cpp:16:13: error: 'x' was not declared in this scope x=c[i]-'0'; ^ genmat15.cpp:18:17: error: 'k' was not declared in this scope k++; ^ genmat15.cpp:20:9: error: 't' was not declared in this scope t[k]=s[0]; ^ genmat15.cpp:20:11: error: 'k' was not declared in this scope t[k]=s[0]; ^ genmat15.cpp:21:9: error: 'j' was not declared in this scope j=k-1; ^ genmat15.cpp:22:9: error: 'z' was not declared in this scope z=k+1; ^ genmat15.cpp:23:13: error: 'i' was not declared in this scope for(i=1; i<strlen(s); i++) ^ genmat15.cpp:25:13: error: 'x' was not declared in this scope x=c[i]-'0'; ^ genmat15.cpp:38:14: error: 't' was not declared in this scope strcpy(s,t); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat15 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ă.