#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 | #23194422 | Utilizator | |
Fișier | genmat12.cpp | Dimensiune | 487 B |
Data încărcării | 30 Mai 2020, 11:38 | Scor / rezultat | Eroare de compilare |
genmat12.cpp:1:9: error: #include expects "FILENAME" or <FILENAME> #include <bits/stdc++.h> ^ genmat12.cpp:2:1: error: stray '\302' in program using namespace std; ^ genmat12.cpp:2:1: error: stray '\240' in program genmat12.cpp:2:1: error: stray '\302' in program genmat12.cpp:2:1: error: stray '\240' in program genmat12.cpp:3:1: error: stray '\302' in program int n,k,a[25][25]; ^ genmat12.cpp:3:1: error: stray '\240' in program genmat12.cpp:4:1: error: stray '\302' in program int main(){ ^ genmat12.cpp:4:1: error: stray '\240' in program genmat12.cpp:5:5: error: stray '\302' in program cin >> n >> k; ^ genmat12.cpp:5:5: error: stray '\240' in program genmat12.cpp:5:5: error: stray '\302' in program genmat12.cpp:5:5: error: stray '\240' in program genmat12.cpp:5:5: error: stray '\302' in program genmat12.cpp:5:5: error: stray '\240' in program genmat12.cpp:5:5: error: stray '\302' in program genmat12.cpp:5:5: error: stray '\240' in program genmat12.cpp:6:5: error: stray '\302' in program for(int i=1;i<=n;i++) ^ genmat12.cpp:6:5: error: stray '\240' in program genmat12.cpp:7:9: error: stray '\302' in program for(int j=1;j<=n;j++) ^ genmat12.cpp:7:9: error: stray '\240' in program genmat12.cpp:8:9: error: stray '\302' in program if(i<=k and j<=k) a[i][j]=1; ^ genmat12.cpp:8:9: error: stray '\240' in program genmat12.cpp:8:9: error: stray '\302' in program genmat12.cpp:8:9: error: stray '\240' in program genmat12.cpp:8:9: error: stray '\302' in program genmat12.cpp:8:9: error: stray '\240' in program genmat12.cpp:9:9: error: stray '\302' in program else if(i<=k and j>k) a[i][j]=2; ^ genmat12.cpp:9:9: error: stray '\240' in program genmat12.cpp:9:9: error: stray '\302' in program genmat12.cpp:9:9: error: stray '\240' in program genmat12.cpp:9:9: error: stray '\302' in program genmat12.cpp:9:9: error: stray '\240' in program genmat12.cpp:9:9: error: stray '\302' in program genmat12.cpp:9:9: error: stray '\240' in program genmat12.cpp:10:9: error: stray '\302' in program else if(i>k and j<=k) a[i][j]=3; ^ genmat12.cpp:10:9: error: stray '\240' in program genmat12.cpp:10:9: error: stray '\302' in program genmat12.cpp:10:9: error: stray '\240' in program genmat12.cpp:10:9: error: stray '\302' in program genmat12.cpp:10:9: error: stray '\240' in program genmat12.cpp:10:9: error: stray '\302' in program genmat12.cpp:10:9: error: stray '\240' in program genmat12.cpp:11:9: error: stray '\302' in program else a[i][j]=4; ^ genmat12.cpp:11:9: error: stray '\240' in program genmat12.cpp:12:9: error: stray '\302' in program for(int i=1;i<=n;i++){ ^ genmat12.cpp:12:9: error: stray '\240' in program genmat12.cpp:13:9: error: stray '\302' in program for(int j=1;j<=n;j++) ^ genmat12.cpp:13:9: error: stray '\240' in program genmat12.cpp:14:13: error: stray '\302' in program cout << a[i][j] << " "; ^ genmat12.cpp:14:13: error: stray '\240' in program genmat12.cpp:14:13: error: stray '\302' in program genmat12.cpp:14:13: error: stray '\240' in program genmat12.cpp:14:13: error: stray '\302' in program genmat12.cpp:14:13: error: stray '\240' in program genmat12.cpp:14:13: error: stray '\302' in program genmat12.cpp:14:13: error: stray '\240' in program genmat12.cpp:15:9: error: stray '\302' in program cout << endl; ^ genmat12.cpp:15:9: error: stray '\240' in program genmat12.cpp:15:9: error: stray '\302' in program genmat12.cpp:15:9: error: stray '\240' in program genmat12.cpp:17:5: error: stray '\302' in program return 0; ^ genmat12.cpp:17:5: error: stray '\240' in program genmat12.cpp: In function 'int main()': genmat12.cpp:5:5: error: 'cin' was not declared in this scope cin >> n >> k; ^ genmat12.cpp:14:13: error: 'cout' was not declared in this scope cout << a[i][j] << " "; ^ genmat12.cpp:15:9: error: 'cout' was not declared in this scope cout << endl; ^ genmat12.cpp:15:19: error: 'endl' was not declared in this scope cout << endl; ^
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ă.