#1313
Produs_Matrice
Se citesc doua matrice din fisier . Sa se calculeze produsul lor .
Problema | Produs_Matrice | Operații I/O |
produs_matrice.in /produs_matrice.out
|
---|---|---|---|
Limita timp | 0.05 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51902338 | Utilizator | |
Fișier | produs_matrice.c | Dimensiune | 3.06 KB |
Data încărcării | 06 Septembrie 2024, 00:05 | Scor / rezultat | Eroare de compilare |
produs_matrice.c:26:5: error: expected specifier-qualifier-list before 'sarg' sarg(int n1, int n2): nr1(n1), nr2(n2){} ^ produs_matrice.c: In function 'inmul': produs_matrice.c:31:15: error: 'static_cast' undeclared (first use in this function) int nr1 = static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:31:15: note: each undeclared identifier is reported only once for each function it appears in produs_matrice.c:31:27: error: 'sarg' undeclared (first use in this function) int nr1 = static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:31:32: error: expected expression before '>' token int nr1 = static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:32:32: error: expected expression before '>' token int nr2 = static_cast<sarg*>(arg) -> nr2; ^ produs_matrice.c:34:16: error: 'new' undeclared (first use in this function) int* ans = new int(dans); ^ produs_matrice.c:34:20: error: expected ',' or ';' before 'int' int* ans = new int(dans); ^ produs_matrice.c:35:30: error: expected expression before 'void' void* vans = static_cast<void*>(ans); ^ produs_matrice.c:34:10: warning: unused variable 'ans' [-Wunused-variable] int* ans = new int(dans); ^ produs_matrice.c:33:9: warning: unused variable 'dans' [-Wunused-variable] int dans = nr1 * nr2; ^ produs_matrice.c: In function 'mul': produs_matrice.c:40:13: error: 'static_cast' undeclared (first use in this function) int lin=static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:40:25: error: 'sarg' undeclared (first use in this function) int lin=static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:40:30: error: expected expression before '>' token int lin=static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:41:30: error: expected expression before '>' token int col=static_cast<sarg*>(arg) -> nr2; ^ produs_matrice.c:46:19: error: 'parg' undeclared (first use in this function) sarg* parg = new sarg(a[lin][ireal], b[ireal][col]); ^ produs_matrice.c:46:26: error: 'new' undeclared (first use in this function) sarg* parg = new sarg(a[lin][ireal], b[ireal][col]); ^ produs_matrice.c:46:30: error: expected ';' before 'sarg' sarg* parg = new sarg(a[lin][ireal], b[ireal][col]); ^ produs_matrice.c:47:37: error: expected expression before 'void' void* arg = static_cast<void*>(parg); ^ produs_matrice.c:45:17: warning: unused variable 'ireal' [-Wunused-variable] int ireal = i + 1; ^ produs_matrice.c:55:32: error: expected expression before 'int' int* pnr = static_cast<int*>(status); ^ produs_matrice.c:59:22: error: expected ',' or ';' before 'int' int* psuma = new int(suma); ^ produs_matrice.c:60:29: error: expected expression before 'void' void* ans = static_cast<void*>(psuma); ^ produs_matrice.c:59:10: warning: unused variable 'psuma' [-Wunused-variable] int* psuma = new int(suma); ^ produs_matrice.c:41:9: warning: unused variable 'col' [-Wunused-variable] int col=static_cast<sarg*>(arg) -> nr2; ^ produs_matrice.c:40:9: warning: unused variable 'lin' [-Wunused-variable] int lin=static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c: In function 'test_imul': produs_matrice.c:68:5: error: unknown type name 'sarg' sarg *arg = new sarg(a, b); ^ produs_matrice.c:68:17: error: 'new' undeclared (first use in this function) sarg *arg = new sarg(a, b); ^ produs_matrice.c:68:21: error: expected ',' or ';' before 'sarg' sarg *arg = new sarg(a, b); ^ produs_matrice.c:69:18: error: 'static_cast' undeclared (first use in this function) void* varg = static_cast<void*>(arg); ^ produs_matrice.c:69:30: error: expected expression before 'void' void* varg = static_cast<void*>(arg); ^ produs_matrice.c:73:26: error: expected expression before 'int' int *x = static_cast<int*>(ans); ^ produs_matrice.c:68:11: warning: unused variable 'arg' [-Wunused-variable] sarg *arg = new sarg(a, b); ^ produs_matrice.c:66:9: warning: unused variable 'b' [-Wunused-variable] int b = 4; ^ produs_matrice.c:65:9: warning: unused variable 'a' [-Wunused-variable] int a = 25; ^ produs_matrice.c: In function 'rez': produs_matrice.c:84:67: error: 'static_cast' undeclared (first use in this function) if ( pthread_create(&th[(i-1)*bcol+(j-1)], NULL, mul, static_cast<void*>(new sarg(i, j)))) ^ produs_matrice.c:84:79: error: expected expression before 'void' if ( pthread_create(&th[(i-1)*bcol+(j-1)], NULL, mul, static_cast<void*>(new sarg(i, j)))) ^ produs_matrice.c:101:37: error: expected expression before 'int' int* pres = static_cast<int*>(res); ^ produs_matrice.c: In function 'citire': produs_matrice.c:7:10: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &alin, &bcol); ^ produs_matrice.c:12:18: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &a[i][j]); ^ produs_matrice.c:15:10: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &bcol); ^ produs_matrice.c:20:18: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &b[i][j]); ^ produs_matrice.c: In function 'main': produs_matrice.c:121:12: warning: ignoring return value of 'freopen', declared with attribute warn_unused_result [-Wunused-result] freopen("produs_matrice.in", "r", stdin); ^ produs_matrice.c:122:12: warning: ignoring return value of 'freopen', declared with attribute warn_unused_result [-Wunused-result] freopen("produs_matrice.out", "w", stdout); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Produs_Matrice 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ă.