Detalii evaluare #31078638

Rezumat problemă

Să se scrie un program care citeşte de la tastatură un şir de numere naturale şi determină suma lor.

Detalii

Problema suma_n Operații I/O tastatură/ecran
Limita timp 1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #31078638 Utilizator Carp Rafael (Nope)
Fișier suma_n.cpp Dimensiune 5.12 KB
Data încărcării 01 Octombrie 2021, 12:28 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

suma_n.cpp:73:17: error: stray '@' in program
             s = @"El a zis: 'Nihil sine Deo'.";

                 ^
suma_n.cpp:74:17: error: stray '@' in program
             t = @"c:\teste\12A\csharp\a.txt";

                 ^
suma_n.cpp:77:17: error: stray '@' in program
             t = @"Lista elevilor:

                 ^
suma_n.cpp:77:18: warning: missing terminating " character [enabled by default]
             t = @"Lista elevilor:

                  ^
suma_n.cpp:77:13: error: missing terminating " character
             t = @"Lista elevilor:

             ^
suma_n.cpp:81:8: warning: missing terminating " character [enabled by default]
 Barutzu";

        ^
suma_n.cpp:81:1: error: missing terminating " character
 Barutzu";

 ^
suma_n.cpp:84:17: error: stray '@' in program
             t = @"Ana 'are' \ mere

                 ^
suma_n.cpp:84:18: warning: missing terminating " character [enabled by default]
             t = @"Ana 'are' \ mere

                  ^
suma_n.cpp:84:13: error: missing terminating " character
             t = @"Ana 'are' \ mere

             ^
suma_n.cpp:85:4: warning: multi-character character constant [-Wmultichar]
 si 'pere'";

    ^
suma_n.cpp:85:10: warning: missing terminating " character [enabled by default]
 si 'pere'";

          ^
suma_n.cpp:85:1: error: missing terminating " character
 si 'pere'";

 ^
suma_n.cpp:120:31: error: stray '@' in program
             Console.WriteLine(@"Cuvinte care incep cu 'sta':");

                               ^
suma_n.cpp:124:31: error: stray '@' in program
             Console.WriteLine(@"Cuvinte care se termina cu 'al':");

                               ^
suma_n.cpp:4:7: error: expected nested-name-specifier before 'System'
 using System;

       ^
suma_n.cpp:4:7: error: 'System' has not been declared
suma_n.cpp:5:7: error: expected nested-name-specifier before 'System'
 using System.Collections.Generic;

       ^
suma_n.cpp:5:7: error: 'System' has not been declared
suma_n.cpp:5:13: error: expected ';' before '.' token
 using System.Collections.Generic;

             ^
suma_n.cpp:5:13: error: expected unqualified-id before '.' token
suma_n.cpp:6:7: error: expected nested-name-specifier before 'System'
 using System.Linq;

       ^
suma_n.cpp:6:7: error: 'System' has not been declared
suma_n.cpp:6:13: error: expected ';' before '.' token
 using System.Linq;

             ^
suma_n.cpp:6:13: error: expected unqualified-id before '.' token
suma_n.cpp:7:7: error: expected nested-name-specifier before 'System'
 using System.Text;

       ^
suma_n.cpp:7:7: error: 'System' has not been declared
suma_n.cpp:7:13: error: expected ';' before '.' token
 using System.Text;

             ^
suma_n.cpp:7:13: error: expected unqualified-id before '.' token
suma_n.cpp:8:7: error: expected nested-name-specifier before 'System'
 using System.Threading.Tasks;

       ^
suma_n.cpp:8:7: error: 'System' has not been declared
suma_n.cpp:8:13: error: expected ';' before '.' token
 using System.Threading.Tasks;

             ^
suma_n.cpp:8:13: error: expected unqualified-id before '.' token
suma_n.cpp:14:26: error: 'string' has not been declared
         static void Main(string[] args)

                          ^
suma_n.cpp:14:35: error: expected ',' or '...' before 'args'
         static void Main(string[] args)

                                   ^
suma_n.cpp:176:5: error: expected ';' after class definition
     }

     ^
suma_n.cpp: In static member function 'static void p07_string::Program::Main(int*)':
suma_n.cpp:46:13: error: 'string' was not declared in this scope
             string s = "1234abcd";

             ^
suma_n.cpp:46:20: error: expected ';' before 's'
             string s = "1234abcd";

                    ^
suma_n.cpp:47:13: error: 'Console' was not declared in this scope
             Console.WriteLine("Am " + "21 de ani");

             ^
suma_n.cpp:47:39: error: invalid operands of types 'const char [4]' and 'const char [10]' to binary 'operator+'
             Console.WriteLine("Am " + "21 de ani");

                                       ^
suma_n.cpp:48:13: error: 's' was not declared in this scope
             s += "90" + 33;

             ^
suma_n.cpp:52:20: error: request for member 'ToString' in 'x', which is of non-class type 'int'
             s += x.ToString();// converteste explicit

                    ^
suma_n.cpp:61:20: error: expected ';' before 't'
             string t = "abcd";

                    ^
suma_n.cpp:63:22: error: 't' was not declared in this scope
             if (s != t) Console.WriteLine("Nu-s egale");

                      ^
suma_n.cpp:66:13: error: 't' was not declared in this scope
             t = s;

             ^
suma_n.cpp:74:18: warning: unknown escape sequence: '\c' [enabled by default]
             t = @"c:\teste\12A\csharp\a.txt";

                  ^
suma_n.cpp:78:1: error: 'Popescu' was not declared in this scope
 Popescu

 ^
suma_n.cpp:79:1: error: expected ';' before 'Ionescu'
 Ionescu

 ^
suma_n.cpp:85:1: error: 'si' was not declared in this scope
 si 'pere'";

 ^
suma_n.cpp:85:4: error: expected ';' before '\x70657265'
 si 'pere'";

    ^
suma_n.cpp:88:20: error: expected ';' before 'w'
             string w = "ana are mere";

                    ^
suma_n.cpp:89:21: error: 'w' was not declared in this scope
             int n = w.Length;

                     ^
suma_n.cpp:117:20: error: expected primary-expression before ']' token
             string[] q = {"start", "stop", "final",

                    ^
suma_n.cpp:117:22: error: expected ';' before 'q'
             string[] q = {"start", "stop", "final",

                      ^
suma_n.cpp:121:29: error: expected ')' before 'v'
             foreach (string v in q)

                             ^
suma_n.cpp:121:35: error: 'foreach' was not declared in this scope
             foreach (string v in q)

                                   ^
suma_n.cpp:122:17: error: expected ';' before 'if'
                 if (v.StartsWith("sta"))

                 ^
suma_n.cpp:125:28: error: expected ')' before 'v'
             foreach(string v in q)

                            ^
suma_n.cpp:126:17: error: expected ';' before 'if'
                 if (v.EndsWith("al"))

                 ^
suma_n.cpp:144:17: error: expected unqualified-id before '[' token
             char[] lit = { 'm', 'p', 'r' };

                 ^
suma_n.cpp:146:44: error: 'lit' was not declared in this scope
             Console.WriteLine(s.IndexOfAny(lit));

                                            ^
suma_n.cpp:148:22: error: expected primary-expression before ']' token
             new char[]{'e','p'}));

                      ^
suma_n.cpp:148:31: error: too many initializers for 'char [1]'
             new char[]{'e','p'}));

                               ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema suma_n face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.