#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 | #51902349 | Utilizator | |
Fișier | produs_matrice.c | Dimensiune | 2.89 KB |
Data încărcării | 06 Septembrie 2024, 00:08 | Scor / rezultat | Eroare de compilare |
produs_matrice.c:28:1: error: unknown type name 'sarg' sarg creaza_sarg(int i, int j) ^ produs_matrice.c: In function 'creaza_sarg': produs_matrice.c:30:5: error: unknown type name 'sarg' sarg ans; ^ produs_matrice.c:31:8: error: request for member 'nr1' in something not a structure or union ans.nr1 = i; ^ produs_matrice.c:32:8: error: request for member 'nr2' in something not a structure or union ans.nr2 = j; ^ produs_matrice.c: In function 'inmul': produs_matrice.c:37:15: error: 'static_cast' undeclared (first use in this function) int nr1 = static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:37:15: note: each undeclared identifier is reported only once for each function it appears in produs_matrice.c:37:27: error: 'sarg' undeclared (first use in this function) int nr1 = static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:37:32: error: expected expression before '>' token int nr1 = static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:38:32: error: expected expression before '>' token int nr2 = static_cast<sarg*>(arg) -> nr2; ^ produs_matrice.c:40:16: error: 'new' undeclared (first use in this function) int* ans = new int(dans); ^ produs_matrice.c:40:20: error: expected ',' or ';' before 'int' int* ans = new int(dans); ^ produs_matrice.c:41:30: error: expected expression before 'void' void* vans = static_cast<void*>(ans); ^ produs_matrice.c:40:10: warning: unused variable 'ans' [-Wunused-variable] int* ans = new int(dans); ^ produs_matrice.c:39:9: warning: unused variable 'dans' [-Wunused-variable] int dans = nr1 * nr2; ^ produs_matrice.c: In function 'mul': produs_matrice.c:46:13: error: 'static_cast' undeclared (first use in this function) int lin=static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:46:25: error: 'sarg' undeclared (first use in this function) int lin=static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:46:30: error: expected expression before '>' token int lin=static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c:47:30: error: expected expression before '>' token int col=static_cast<sarg*>(arg) -> nr2; ^ produs_matrice.c:52:18: error: expected ';' before 'idk' sarg idk = creaza_sarg(a[lin][ireal], b[ireal][col]); ^ produs_matrice.c:53:19: error: 'parg' undeclared (first use in this function) sarg* parg = new sarg(idk); ^ produs_matrice.c:53:26: error: 'new' undeclared (first use in this function) sarg* parg = new sarg(idk); ^ produs_matrice.c:53:30: error: expected ';' before 'sarg' sarg* parg = new sarg(idk); ^ produs_matrice.c:54:37: error: expected expression before 'void' void* arg = static_cast<void*>(parg); ^ produs_matrice.c:51:17: warning: unused variable 'ireal' [-Wunused-variable] int ireal = i + 1; ^ produs_matrice.c:62:32: error: expected expression before 'int' int* pnr = static_cast<int*>(status); ^ produs_matrice.c:66:22: error: expected ',' or ';' before 'int' int* psuma = new int(suma); ^ produs_matrice.c:67:29: error: expected expression before 'void' void* ans = static_cast<void*>(psuma); ^ produs_matrice.c:66:10: warning: unused variable 'psuma' [-Wunused-variable] int* psuma = new int(suma); ^ produs_matrice.c:47:9: warning: unused variable 'col' [-Wunused-variable] int col=static_cast<sarg*>(arg) -> nr2; ^ produs_matrice.c:46:9: warning: unused variable 'lin' [-Wunused-variable] int lin=static_cast<sarg*>(arg) -> nr1; ^ produs_matrice.c: In function 'rez': produs_matrice.c:77:13: error: unknown type name 'sarg' sarg idk = creaza_sarg(i, j); ^ produs_matrice.c:78: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(idk))) ) ^ produs_matrice.c:78:79: error: expected expression before 'void' if ( pthread_create(&th[(i-1)*bcol+(j-1)], NULL, mul, static_cast<void*>(new sarg(idk))) ) ^ produs_matrice.c:77:18: warning: unused variable 'idk' [-Wunused-variable] sarg idk = creaza_sarg(i, j); ^ produs_matrice.c:95: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:115:12: warning: ignoring return value of 'freopen', declared with attribute warn_unused_result [-Wunused-result] freopen("produs_matrice.in", "r", stdin); ^ produs_matrice.c:116: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ă.