#659
SumaLinii1
Gigel a găsit o matrice cu n
linii și m
coloane și elemente numere naturale. El își propune să determine, pentru fiecare linie, cea mai mică valoare care se poate obține adunând elementele de pe linie, cu excepția unuia.
Problema | SumaLinii1 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51648516 | Utilizator | |
Fișier | sumalinii1.cpp | Dimensiune | 850 B |
Data încărcării | 27 Iulie 2024, 16:43 | Scor / rezultat | Eroare de compilare |
sumalinii1.cpp:1:1: error: 'import' does not name a type import java.util.Scanner; ^ sumalinii1.cpp:4:12: error: expected ':' before 'static' public static void main(String[] args) { ^ sumalinii1.cpp:4:29: error: 'String' has not been declared public static void main(String[] args) { ^ sumalinii1.cpp:4:38: error: expected ',' or '...' before 'args' public static void main(String[] args) { ^ sumalinii1.cpp:32:1: error: expected ';' after class definition } ^ sumalinii1.cpp: In static member function 'static void HelloWorld::main(int*)': sumalinii1.cpp:5:9: error: 'Scanner' was not declared in this scope Scanner keyboard = new Scanner(System.in); ^ sumalinii1.cpp:5:17: error: expected ';' before 'keyboard' Scanner keyboard = new Scanner(System.in); ^ sumalinii1.cpp:6:17: error: 'keyboard' was not declared in this scope int n = keyboard.nextInt(); ^ sumalinii1.cpp:8:19: error: declaration of 'mat' as multidimensional array must have bounds for all dimensions except the first int mat[][]=new int[n][m],maxi,s,i,j; ^ sumalinii1.cpp:8:33: error: array size in operator new must be constant int mat[][]=new int[n][m],maxi,s,i,j; ^ sumalinii1.cpp:8:33: error: the value of 'm' is not usable in a constant expression sumalinii1.cpp:15:13: error: 'i' was not declared in this scope for(i=0;i<n;i++){ ^ sumalinii1.cpp:16:17: error: 'j' was not declared in this scope for(j=0;j<m;j++){ ^ sumalinii1.cpp:17:17: error: 'mat' was not declared in this scope mat[i][j]=keyboard.nextInt(); ^ sumalinii1.cpp:20:13: error: 'i' was not declared in this scope for(i=0;i<n;i++){ ^ sumalinii1.cpp:21:13: error: 'maxi' was not declared in this scope maxi=0; ^ sumalinii1.cpp:22:13: error: 's' was not declared in this scope s=0; ^ sumalinii1.cpp:23:17: error: 'j' was not declared in this scope for(j=0;j<m;j++){ ^ sumalinii1.cpp:24:20: error: 'mat' was not declared in this scope s+=mat[i][j]; ^ sumalinii1.cpp:29:13: error: 'System' was not declared in this scope System.out.print(s+ " "); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumaLinii1 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ă.