#1360
Suma Gauss
Se citește n
număr natural. Calculați suma numerelor naturale mai mici sau egale cu n
.
Problema | Suma Gauss | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #33737294 | Utilizator | |
Fișier | suma_gauss.cpp | Dimensiune | 1.24 KB |
Data încărcării | 07 Ianuarie 2022, 11:19 | Scor / rezultat | Eroare de compilare |
suma_gauss.cpp:18:1: warning: "/*" within comment [-Wcomment] /* ^ suma_gauss.cpp:26:16: error: expected ':' before 'int' public int pix; ^ suma_gauss.cpp:27:16: error: expected ':' before 'static' public static int creta; ^ suma_gauss.cpp:28:16: error: expected ':' before 'Test' public Test() ^ suma_gauss.cpp:32:16: error: expected ':' before 'Test' public Test(int _p, int _c) ^ suma_gauss.cpp:37:16: error: expected ':' before 'void' public void Add() ^ suma_gauss.cpp:42:16: error: expected ':' before 'void' public void Afis() ^ suma_gauss.cpp:46:16: error: expected ':' before 'static' public static void F() ^ suma_gauss.cpp:50:5: error: expected ';' after class definition } ^ suma_gauss.cpp: In constructor 'p026_static::Test::Test(int, int)': suma_gauss.cpp:34:18: error: request for member 'pix' in 'this', which is of pointer type 'p026_static::Test* const' (maybe you meant to use '->' ?) this.pix = _p; ^ suma_gauss.cpp: In member function 'void p026_static::Test::Afis()': suma_gauss.cpp:44:13: error: 'Console' was not declared in this scope Console.WriteLine(pix + " " + creta); ^ suma_gauss.cpp: In static member function 'static void p026_static::Test::F()': suma_gauss.cpp:48:13: error: 'Console' was not declared in this scope Console.WriteLine("Apelare functie statica"); ^ suma_gauss.cpp: At global scope: suma_gauss.cpp:54:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ suma_gauss.cpp:65:5: error: expected ';' after class definition } ^ suma_gauss.cpp: In static member function 'static void p026_static::Program::Main(std::string*)': suma_gauss.cpp:57:15: error: no match for 'operator=' (operand types are 'p026_static::Test' and 'p026_static::Test*') a = new Test(); ^ suma_gauss.cpp:57:15: note: candidates are: suma_gauss.cpp:24:11: note: p026_static::Test& p026_static::Test::operator=(const p026_static::Test&) class Test ^ suma_gauss.cpp:24:11: note: no known conversion for argument 1 from 'p026_static::Test*' to 'const p026_static::Test&' suma_gauss.cpp:24:11: note: p026_static::Test& p026_static::Test::operator=(p026_static::Test&&) suma_gauss.cpp:24:11: note: no known conversion for argument 1 from 'p026_static::Test*' to 'p026_static::Test&&' suma_gauss.cpp:58:15: error: no match for 'operator=' (operand types are 'p026_static::Test' and 'p026_static::Test*') b = new Test(); ^ suma_gauss.cpp:58:15: note: candidates are: suma_gauss.cpp:24:11: note: p026_static::Test& p026_static::Test::operator=(const p026_static::Test&) class Test ^ suma_gauss.cpp:24:11: note: no known conversion for argument 1 from 'p026_static::Test*' to 'const p026_static::Test&' suma_gauss.cpp:24:11: note: p026_static::Test& p026_static::Test::operator=(p026_static::Test&&) suma_gauss.cpp:24:11: note: no known conversion for argument 1 from 'p026_static::Test*' to 'p026_static::Test&&' suma_gauss.cpp:63:17: error: expected unqualified-id before '.' token Test.F(); ^ suma_gauss.cpp: At global scope: suma_gauss.cpp:67:3: error: expected unqualified-id before '/' token **/ ^ suma_gauss.cpp:67:3: error: expected constructor, destructor, or type conversion before '/' token
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Suma Gauss 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ă.