Detalii evaluare #54255355

Rezumat problemă

#2641 AF

Gigel are ca temă la matematică să precizeze valoarea de adevăr a unor expresii de forma nr1 semn nr2 = nr3, unde nr1, nr2 și nr3 sunt numere naturale, iar semn poate fi +, -, x sau : reprezintând adunarea, scăderea, înmulțirea și împărțirea. Ajutați-l pe Gigel să rezolve tema la matematică.

Detalii

Problema AF Operații I/O af.in/af.out
Limita timp 1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #54255355 Utilizator Roxana Calin (CalinRoxanaMaria)
Fișier af.cpp Dimensiune 995 B
Data încărcării 23 Noiembrie 2024, 16:50 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

af.cpp: In function 'int main()':
af.cpp:10:5: error: reference to 'cin' is ambiguous
     cin >> n;

     ^
af.cpp:4:10: note: candidates are: std::ifstream cin
 ifstream cin("af.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
af.cpp:15:9: error: reference to 'cin' is ambiguous
         cin >> x >> c1 >> y >> c2 >> z;

         ^
af.cpp:4:10: note: candidates are: std::ifstream cin
 ifstream cin("af.in");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
af.cpp:18:17: error: reference to 'cout' is ambiguous
                 cout << "Adevarat" << '\n';

                 ^
af.cpp:5:10: note: candidates are: std::ofstream cout
 ofstream cout("af.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
af.cpp:20:17: error: reference to 'cout' is ambiguous
                 cout << "Fals" << '\n';

                 ^
af.cpp:5:10: note: candidates are: std::ofstream cout
 ofstream cout("af.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
af.cpp:16:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
         if(c1=='+')

           ^
af.cpp:23:17: error: reference to 'cout' is ambiguous
                 cout << "Adevarat" << '\n';

                 ^
af.cpp:5:10: note: candidates are: std::ofstream cout
 ofstream cout("af.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
af.cpp:25:17: error: reference to 'cout' is ambiguous
                 cout << "Fals" << '\n';

                 ^
af.cpp:5:10: note: candidates are: std::ofstream cout
 ofstream cout("af.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
af.cpp:21:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
         if(c1=='-')

           ^
af.cpp:28:17: error: reference to 'cout' is ambiguous
                 cout << "Adevarat" << '\n';

                 ^
af.cpp:5:10: note: candidates are: std::ofstream cout
 ofstream cout("af.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
af.cpp:30:17: error: reference to 'cout' is ambiguous
                 cout << "Fals" << '\n';

                 ^
af.cpp:5:10: note: candidates are: std::ofstream cout
 ofstream cout("af.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
af.cpp:26:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
         if(c1=='x')

           ^
af.cpp:33:17: error: reference to 'cout' is ambiguous
                 cout << "Adevarat" << '\n';

                 ^
af.cpp:5:10: note: candidates are: std::ofstream cout
 ofstream cout("af.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
af.cpp:35:17: error: reference to 'cout' is ambiguous
                 cout << "Fals" << '\n';

                 ^
af.cpp:5:10: note: candidates are: std::ofstream cout
 ofstream cout("af.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
af.cpp:37:17: error: reference to 'cout' is ambiguous
                 cout << "Fals" << '\n';

                 ^
af.cpp:5:10: note: candidates are: std::ofstream cout
 ofstream cout("af.out");

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from af.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^

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