#1
sum
Să se scrie un program care citeşte din fişier două numere întregi şi determină suma lor.
Problema | sum | Operații I/O |
sum.in /sum.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #25298891 | Utilizator | |
Fișier | sum.cpp | Dimensiune | 4.16 KB |
Data încărcării | 02 Noiembrie 2020, 12:42 | Scor / rezultat | Eroare de compilare |
sum.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ sum.cpp:1:7: error: 'System' has not been declared sum.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ sum.cpp:2:7: error: 'System' has not been declared sum.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ sum.cpp:2:13: error: expected unqualified-id before '.' token sum.cpp:3:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ sum.cpp:3:7: error: 'System' has not been declared sum.cpp:3:13: error: expected ';' before '.' token using System.Linq; ^ sum.cpp:3:13: error: expected unqualified-id before '.' token sum.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Text; ^ sum.cpp:4:7: error: 'System' has not been declared sum.cpp:4:13: error: expected ';' before '.' token using System.Text; ^ sum.cpp:4:13: error: expected unqualified-id before '.' token sum.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ sum.cpp:5:7: error: 'System' has not been declared sum.cpp:5:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ sum.cpp:5:13: error: expected unqualified-id before '.' token sum.cpp:12:17: error: expected ':' before 'int' private int[,] a; ^ sum.cpp:12:20: error: expected unqualified-id before '[' token private int[,] a; ^ sum.cpp:13:17: error: expected ':' before 'int' private int n; ^ sum.cpp:14:9: error: 'Random' does not name a type Random r = new Random(); ^ sum.cpp:17:16: error: expected ':' before 'Matrix' public Matrix(int dim, int val) ^ sum.cpp:26:16: error: expected ':' before 'Matrix' public Matrix(int dim) ^ sum.cpp:35:16: error: expected ':' before 'Matrix' public Matrix(Matrix B) ^ sum.cpp:35:31: error: invalid constructor; you probably meant 'p30_Matrix::Matrix (const p30_Matrix::Matrix&)' public Matrix(Matrix B) ^ sum.cpp:45:16: error: expected ':' before 'int' public int this[int i, int j] ^ sum.cpp:45:20: error: expected unqualified-id before 'this' public int this[int i, int j] ^ sum.cpp:151:1: error: expected '}' at end of input } ^ sum.cpp: In constructor 'p30_Matrix::Matrix::Matrix(int, int)': sum.cpp:20:13: error: 'a' was not declared in this scope a = new int[n, n]; ^ sum.cpp:20:28: warning: left operand of comma operator has no effect [-Wunused-value] a = new int[n, n]; ^ sum.cpp:23:26: warning: left operand of comma operator has no effect [-Wunused-value] a[i, j] = val; ^ sum.cpp: In constructor 'p30_Matrix::Matrix::Matrix(int)': sum.cpp:29:13: error: 'a' was not declared in this scope a = new int[n, n]; ^ sum.cpp:29:28: warning: left operand of comma operator has no effect [-Wunused-value] a = new int[n, n]; ^ sum.cpp:32:26: warning: left operand of comma operator has no effect [-Wunused-value] a[i, j] = r.Next(100); ^ sum.cpp:32:31: error: 'r' was not declared in this scope a[i, j] = r.Next(100); ^ sum.cpp: At global scope: sum.cpp:33:9: error: expected unqualified-id at end of input } ^ sum.cpp:33:9: error: expected '}' at end of input
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sum 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ă.