#1508
Element_SA
C++
Să se scrie o funcție C++ care are ca parametri două numere naturale n
și m
și o matrice A(n , m)
avȃnd elemente numere întregi și returnează numărul de elemente „șa” din matrice. Un element A(i,j)
din matrice se numește element „șa” dacă este maximul de pe coloana j
si minimul de pe linia i
sau invers.
Admitere Mate-Info UBB, iulie 2015
Problema | Element_SA | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #9090761 | Utilizator | |
Fișier | element_sa.cpp | Dimensiune | 633 B |
Data încărcării | 03 Aprilie 2018, 12:03 | Scor / rezultat | Eroare de compilare |
element_sa.cpp: In function 'int nr_sa(int (*)[100], int, int)': element_sa.cpp:7:9: error: 'k' was not declared in this scope for(k=0; k<=n-1; k++) ^ element_sa.cpp:10:24: error: 'mal' was not declared in this scope if(a[k][i]>mal) ^ element_sa.cpp:12:17: error: 'mac' was not declared in this scope mac=a[k][i]; ^ element_sa.cpp:13:17: error: 'x' was not declared in this scope x=i; ^ element_sa.cpp:15:29: error: 'mil' was not declared in this scope else if(a[k][i]<mil) ^ element_sa.cpp:17:17: error: 'mic' was not declared in this scope mic=a[k][i]; ^ element_sa.cpp:18:17: error: 'y' was not declared in this scope y=i; ^ element_sa.cpp:21:21: error: 'y' was not declared in this scope if(a[i][y]>mac) ^ element_sa.cpp:21:24: error: 'mac' was not declared in this scope if(a[i][y]>mac) ^ element_sa.cpp:23:12: error: 'mil' was not declared in this scope if(mil==mac) ^ element_sa.cpp:23:17: error: 'mac' was not declared in this scope if(mil==mac) ^ element_sa.cpp:24:13: error: 'nr' was not declared in this scope nr++; ^ element_sa.cpp:26:21: error: 'x' was not declared in this scope if(a[i][x]<mic) ^ element_sa.cpp:26:24: error: 'mic' was not declared in this scope if(a[i][x]<mic) ^ element_sa.cpp:29:12: error: 'mal' was not declared in this scope if(mal=mic) ^ element_sa.cpp:29:16: error: 'mic' was not declared in this scope if(mal=mic) ^ element_sa.cpp:30:13: error: 'nr' was not declared in this scope nr++; ^ element_sa.cpp:32:12: error: 'nr' was not declared in this scope return nr; ^ element_sa.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Element_SA face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.