#1450
Să se afle câte coloane ale unei matrice au produsul elementelor divizibil cu un număr dat p.
| Problema | Memory003 | Operații I/O |
memory003.in/memory003.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 0.3 MB
/
Stivă 0 MB
|
| Id soluție | #64815682 | Utilizator | |
| Fișier | memory003.cpp | Dimensiune | 321 B |
| Data încărcării | 03 Iunie 2026, 10:29 | Scor/rezultat | Eroare de compilare |
memory003.cpp: In function ‘int main()’: memory003.cpp:12:34: error: expected ‘;’ before ‘for’ 12 | for ( i = 1 ; i<=n; i++) v[i] = 1 | ^ | ; 13 | 14 | for ( i = 1 ; i<=n; i++) | ~~~ memory003.cpp:14:16: warning: statement has no effect [-Wunused-value] 14 | for ( i = 1 ; i<=n; i++) | ~^~~ memory003.cpp:14:24: error: expected ‘;’ before ‘)’ token 14 | for ( i = 1 ; i<=n; i++) | ^ | ; memory003.cpp:16:16: warning: statement has no effect [-Wunused-value] 16 | for ( j = 1 ; j<=m; j++) | ~^~~ memory003.cpp:16:24: error: expected ‘;’ before ‘)’ token 16 | for ( j = 1 ; j<=m; j++) | ^ | ; memory003.cpp:8:29: warning: unused variable ‘x’ [-Wunused-variable] 8 | int m, n, p, v [301], i, j, x, c = 0 ; | ^ memory003.cpp:8:32: warning: unused variable ‘c’ [-Wunused-variable] 8 | int m, n, p, v [301], i, j, x, c = 0 ; | ^ memory003.cpp: At global scope: memory003.cpp:20:1: error: ‘cin’ does not name a type 20 | cin>>x; | ^~~ memory003.cpp:22:1: error: ‘v’ does not name a type 22 | v[j]*=x; | ^ memory003.cpp:24:1: error: expected declaration before ‘}’ token 24 | } | ^ memory003.cpp:26:1: error: expected unqualified-id before ‘for’ 26 | for (i = 1) i<=n; i++) if (v[i]%p==0) c++; | ^~~ memory003.cpp:26:19: error: ‘i’ does not name a type 26 | for (i = 1) i<=n; i++) if (v[i]%p==0) c++; | ^ memory003.cpp:28:1: error: ‘cout’ does not name a type 28 | cout<<c; | ^~~~ memory003.cpp:30:1: error: expected unqualified-id before ‘return’ 30 | return 0; | ^~~~~~ memory003.cpp:32:1: error: expected unqualified-id before ‘{’ token 32 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Memory003 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ă.