Detalii evaluare #38119202

Rezumat problemă

#941 Urare

În preajma Crăciunului toţi suntem sau redevenim copii.

Scrie un program care afişează pe ecran o urare pentru cei dragi ţie!

Detalii

Problema Urare Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #38119202 Utilizator Samson Alexia (samsonaexia2019)
Fișier urare.cpp Dimensiune 3.76 KB
Data încărcării 30 Septembrie 2022, 10:01 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

urare.cpp:2:7: error: expected nested-name-specifier before 'System'
 using System;

       ^
urare.cpp:2:7: error: 'System' has not been declared
urare.cpp:3:7: error: expected nested-name-specifier before 'System'
 using System.Collections.Generic;

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

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

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

             ^
urare.cpp:4:13: error: expected unqualified-id before '.' token
urare.cpp:11:17: error: expected ':' before 'int'
         private int nr, nu;//private ca sa nu poata fi modificate din afara

                 ^
urare.cpp:15:16: error: expected ':' before 'rational'
         public rational() { nr = 0; nu = 1; } //il rescrie pe cel implicit

                ^
urare.cpp:16:16: error: expected ':' before 'rational'
         public rational(int a, int b)

                ^
urare.cpp:23:16: error: expected ':' before 'rational'
         public rational (rational r)

                ^
urare.cpp:23:36: error: invalid constructor; you probably meant 'rational::rational (const rational::rational&)'
         public rational (rational r)

                                    ^
urare.cpp:30:16: error: expected ':' before 'rational'
         public rational(int n)

                ^
urare.cpp:39:17: error: expected ':' before 'int'
         private int cmmdc(int a, int b)

                 ^
urare.cpp:49:17: error: expected ':' before 'void'
         private void simplificare()

                 ^
urare.cpp:59:16: error: expected ':' before 'void'
         public void citire()

                ^
urare.cpp:66:16: error: expected ':' before 'void'
         public void afisare()

                ^
urare.cpp:71:16: error: expected ':' before 'rational'
         public rational suma(rational a)

                ^
urare.cpp:80:16: error: expected ':' before 'rational'
         public rational scadere(rational a)

                ^
urare.cpp:89:16: error: expected ':' before 'override'
         public override string ToString()

                ^
urare.cpp:89:16: error: 'override' does not name a type
urare.cpp:95:5: error: expected ';' after class definition
     }

     ^
urare.cpp: In member function 'void rational::rational::simplificare()':
urare.cpp:51:27: error: 'Math' was not declared in this scope
             int c = cmmdc(Math.Abs(nr), Math.Abs(nu));

                           ^
urare.cpp: In member function 'void rational::rational::citire()':
urare.cpp:61:13: error: 'string' was not declared in this scope
             string[] S = Console.ReadLine().Split();

             ^
urare.cpp:61:20: error: expected primary-expression before ']' token
             string[] S = Console.ReadLine().Split();

                    ^
urare.cpp:61:22: error: expected ';' before 'S'
             string[] S = Console.ReadLine().Split();

                      ^
urare.cpp:62:18: error: expected primary-expression before 'int'
             nr = int.Parse(S[0]);

                  ^
urare.cpp:62:18: error: expected ';' before 'int'
urare.cpp:63:18: error: expected primary-expression before 'int'
             nu = int.Parse(S[1]);

                  ^
urare.cpp:63:18: error: expected ';' before 'int'
urare.cpp: In member function 'void rational::rational::afisare()':
urare.cpp:68:13: error: 'Console' was not declared in this scope
             Console.WriteLine(nr + "/" + nu);

             ^
urare.cpp: In member function 'rational::rational rational::rational::suma(rational::rational)':
urare.cpp:74:39: error: invalid conversion from 'rational::rational*' to 'int' [-fpermissive]
             rational s = new rational();

                                       ^
urare.cpp:30:16: error:   initializing argument 1 of 'rational::rational::rational(int)' [-fpermissive]
         public rational(int n)

                ^
urare.cpp: In member function 'rational::rational rational::rational::scadere(rational::rational)':
urare.cpp:82:40: error: invalid conversion from 'rational::rational*' to 'int' [-fpermissive]
             rational sc = new rational();

                                        ^
urare.cpp:30:16: error:   initializing argument 1 of 'rational::rational::rational(int)' [-fpermissive]
         public rational(int n)

                ^
urare.cpp: At global scope:
urare.cpp:101:7: error: expected nested-name-specifier before 'System'
 using System;

       ^
urare.cpp:101:7: error: 'System' has not been declared
urare.cpp:107:26: error: 'string' has not been declared
         static void Main(string[] args)

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

                                   ^
urare.cpp:118:5: error: expected ';' after class definition
     }

     ^
urare.cpp: In static member function 'static void rational::Program::Main(int*)':
urare.cpp:109:42: error: invalid conversion from 'rational::rational*' to 'int' [-fpermissive]
             rational r = new rational(6,7);///instantiere

                                          ^
urare.cpp:30:16: error:   initializing argument 1 of 'rational::rational::rational(int)' [-fpermissive]
         public rational(int n)

                ^
urare.cpp:110:40: error: invalid conversion from 'rational::rational*' to 'int' [-fpermissive]
             rational p = new rational(r);///adaug inca un nr rational

                                        ^
urare.cpp:30:16: error:   initializing argument 1 of 'rational::rational::rational(int)' [-fpermissive]
         public rational(int n)

                ^
urare.cpp:115:13: error: 'Console' was not declared in this scope
             Console.Write(r.ToString() + " ");

             ^
urare.cpp:115:29: error: 'class rational::rational' has no member named 'ToString'
             Console.Write(r.ToString() + " ");

                             ^
urare.cpp: At global scope:
urare.cpp:123:7: error: expected nested-name-specifier before 'System'
 using System;

       ^
urare.cpp:123:7: error: 'System' has not been declared
urare.cpp:133:20: error: expected ':' before 'void'
             public void Citire()

                    ^
urare.cpp:139:20: error: expected ':' before 'void'
             public void Afisare()

                    ^
urare.cpp:143:9: error: expected ';' after class definition
         }

         ^
urare.cpp:144:26: error: 'string' has not been declared
         static void Main(string[] args)

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

                                   ^
urare.cpp:151:5: error: expected ';' after class definition
     }

     ^
urare.cpp: In member function 'void oop::Program::fractie::Citire()':
urare.cpp:135:17: error: 'string' was not declared in this scope
                 string[] S = Console.ReadLine().Split();

                 ^
urare.cpp:135:24: error: expected primary-expression before ']' token
                 string[] S = Console.ReadLine().Split();

                        ^
urare.cpp:135:26: error: expected ';' before 'S'
                 string[] S = Console.ReadLine().Split();

                          ^
urare.cpp:136:22: error: expected primary-expression before 'int'
                 nr = int.Parse(S[0]);

                      ^
urare.cpp:136:22: error: expected ';' before 'int'
urare.cpp:137:22: error: expected primary-expression before 'int'
                 nu = int.Parse(S[1]);

                      ^
urare.cpp:137:22: error: expected ';' before 'int'
urare.cpp: In member function 'void oop::Program::fractie::Afisare()':
urare.cpp:141:17: error: 'Console' was not declared in this scope
                 Console.WriteLine(nr + "/" + nu + " ");

                 ^
urare.cpp:141:51: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
                 Console.WriteLine(nr + "/" + nu + " ");

                                                   ^
urare.cpp: In static member function 'static void oop::Program::Main(int*)':
urare.cpp:146:37: error: conversion from 'oop::Program::fractie*' to non-scalar type 'oop::Program::fractie' requested
             fractie f = new fractie();

                                     ^

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