#1421
tabel
După cum probabil ştiţi, contabilii îşi ţin datele sub formă de tabele şi calculează tot felul de sume pe linii şi pe coloane. Contabilul nostru Atnoc şi-a organizat valorile sub forma unui tabel cu n linii (numerotate de la 1 la n) şi m coloane (numerotate de la 1 la m). Elementele de pe ultima coloană sunt sumele elementelor de pe linii (mai exact, elementul de pe linia i şi coloana m este egal cu suma elementelor de pe linia i aflate pe coloanele 1, 2, …, m-1), iar elementele de pe ultima linie sunt sumele elementelor de pe coloane (mai exact, elementul de pe linia n şi coloana i este egal cu suma elementelor de pe coloana i aflate pe liniile 1, 2, …, n-1).
OJI 2005, clasa a VII-a
Problema | tabel | Operații I/O |
tabel.in /tabel.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #49809162 | Utilizator | |
Fișier | tabel.cpp | Dimensiune | 1.09 KB |
Data încărcării | 15 Martie 2024, 14:11 | Scor / rezultat | Eroare de compilare |
tabel.cpp: In function 'int main()': tabel.cpp:7:10: error: 'n' was not declared in this scope cin>>n>>m>>k; ^ tabel.cpp:7:13: error: 'm' was not declared in this scope cin>>n>>m>>k; ^ tabel.cpp:7:16: error: 'k' was not declared in this scope cin>>n>>m>>k; ^ tabel.cpp:8:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ tabel.cpp:9:9: error: 'nrgl' was not declared in this scope nrgl[i]=n; ^ tabel.cpp:10:9: error: 'i' was not declared in this scope for(i=1; i<=m; i++) ^ tabel.cpp:11:9: error: 'nrgc' was not declared in this scope nrgc[i]=m; ^ tabel.cpp:12:9: error: 'i' was not declared in this scope for(i=1; i<=k; i++) ^ tabel.cpp:14:14: error: 'l' was not declared in this scope cin>>l>>c>>a[l][c]; ^ tabel.cpp:14:17: error: 'c' was not declared in this scope cin>>l>>c>>a[l][c]; ^ tabel.cpp:14:20: error: 'a' was not declared in this scope cin>>l>>c>>a[l][c]; ^ tabel.cpp:15:9: error: 'nrgl' was not declared in this scope nrgl[l]--; ^ tabel.cpp:16:9: error: 'nrgc' was not declared in this scope nrgc[c]--; ^ tabel.cpp:18:9: error: 'i' was not declared in this scope for(i=1; i<n; i++) ^ tabel.cpp:20:13: error: 'j' was not declared in this scope for(j=1; j<m; j++) ^ tabel.cpp:22:13: error: 'sl' was not declared in this scope sl[i]+=a[i][j]; ^ tabel.cpp:22:20: error: 'a' was not declared in this scope sl[i]+=a[i][j]; ^ tabel.cpp:23:13: error: 'sc' was not declared in this scope sc[j]+=a[i][j]; ^ tabel.cpp:28:13: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ tabel.cpp:30:16: error: 'nrgl' was not declared in this scope if(nrgl[i]==1) ^ tabel.cpp:34:20: error: 'a' was not declared in this scope if(a[i][m]==0) ^ tabel.cpp:36:29: error: 'sl' was not declared in this scope a[i][m]=sl[i]; ^ tabel.cpp:37:21: error: 'sc' was not declared in this scope sc[j]+=a[i][j]; ^ tabel.cpp:37:24: error: 'j' was not declared in this scope sc[j]+=a[i][j]; ^ tabel.cpp:38:21: error: 'nrgc' was not declared in this scope nrgc[m]--; ^ tabel.cpp:40:21: error: 'j' was not declared in this scope for(j=1; j<m; j++) ^ tabel.cpp:41:24: error: 'a' was not declared in this scope if(a[i][j]==0) ^ tabel.cpp:43:41: error: 'sl' was not declared in this scope a[i][j]=a[i][m]-sl[i]; ^ tabel.cpp:44:25: error: 'sc' was not declared in this scope sc[j]+=a[i][j]; ^ tabel.cpp:45:25: error: 'nrgc' was not declared in this scope nrgc[j]--; ^ tabel.cpp:51:13: error: 'j' was not declared in this scope for(j=1;j<=m;j++) ^ tabel.cpp:52:5: error: expected primary-expression before '}' token } ^ tabel.cpp:52:5: error: expected ';' before '}' token
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema tabel 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ă.