#225
GenMat12
Scrieţi un program care citeşte de la tastatură doua numere naturale n
şi k
şi construieşte în memorie o matrice cu n
linii şi n
coloane formată numai din valori 1
, 2
, 3
şi 4
astfel încât: elementele aflate la intersecţia primelor k
linii cu primele k
coloane sunt egale cu 1
, elementele aflate la intersecţia primelor k
linii cu ultimele n-k
coloane sunt egale cu 2
, elementele aflate la intersecţia ultimelor n-k
linii cu primele k
coloane sunt egale cu 3
, elementele aflate la intersecţia ultimelor n-k
linii cu ultimele n-k
coloane sunt egale cu 4
.
Variante Bacalaureat 2009
Problema | GenMat12 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49863684 | Utilizator | |
Fișier | genmat12.cpp | Dimensiune | 416 B |
Data încărcării | 18 Martie 2024, 11:13 | Scor / rezultat | 0 puncte |
genmat12.cpp: In function 'int main()': genmat12.cpp:11:6: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] {if(1<=i<=k&&1<=j<=k)a[i][j]=1; ^ genmat12.cpp:11:15: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] {if(1<=i<=k&&1<=j<=k)a[i][j]=1; ^ genmat12.cpp:12:5: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if(1<=i<=k&&n-(n-k)<=j<=n)a[i][j]=2; ^ genmat12.cpp:12:20: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if(1<=i<=k&&n-(n-k)<=j<=n)a[i][j]=2; ^ genmat12.cpp:13:5: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if(1<=j<=k&&n-(n-k)<=i<=n)a[i][j]=3; ^ genmat12.cpp:13:20: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if(1<=j<=k&&n-(n-k)<=i<=n)a[i][j]=3; ^ genmat12.cpp:14:11: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if(n-(n-k)<=j<=n&&n-(n-k)<=i<=n)a[i][j]=4;} ^ genmat12.cpp:14:26: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses] if(n-(n-k)<=j<=n&&n-(n-k)<=i<=n)a[i][j]=4;} ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 40 | 0 | ||
3 | 0 secunde | Raspuns gresit. | 40 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat12 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ă.