Detalii evaluare #53433778

Rezumat problemă

Scrieţi un program care să citească o ecuație de un anumit tip și care să determine: a) tipul ecuației citite; b) soluția ecuației obținută prin rezolvarea acestei ecuații.

propunere OJI 2015 cls 6

Detalii

Problema ecuatie2 Operații I/O ecuatie2.in/ecuatie2.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #53433778 Utilizator Andrei Stefan Daniel (stefffandr)
Fișier ecuatie2.cpp Dimensiune 2.10 KB
Data încărcării 30 Octombrie 2024, 13:04 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

ecuatie2.cpp: In function 'int main()':
ecuatie2.cpp:8:5: error: reference to 'cin' is ambiguous
     cin >> s;

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

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

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:16:13: error: reference to 'cin' is ambiguous
             cin >> s;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
ecuatie2.cpp:22:13: error: reference to 'cin' is ambiguous
             cin >> b;

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

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

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:28:13: error: reference to 'cin' is ambiguous
             cin >> s;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
ecuatie2.cpp:34:13: error: reference to 'cin' is ambiguous
             cin >> b;

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

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

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:40:13: error: reference to 'cin' is ambiguous
             cin >> s;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
ecuatie2.cpp:46:13: error: reference to 'cin' is ambiguous
             cin >> b;

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

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

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:52:13: error: reference to 'cin' is ambiguous
             cin >> s;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
ecuatie2.cpp:58:13: error: reference to 'cin' is ambiguous
             cin >> b;

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
ecuatie2.cpp:59:13: error: reference to 'cout' is ambiguous
             cout << a * b;

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:69:13: error: reference to 'cin' is ambiguous
             cin >> s;

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:60:18: note:                 std::istream std::cin
   extern istream cin;  /// Linked to standard input
                  ^
ecuatie2.cpp:73:13: error: reference to 'cin' is ambiguous
             cin >> s;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:75:13: error: reference to 'cin' is ambiguous
             cin >> s >> b;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:80:13: error: reference to 'cin' is ambiguous
             cin >> s;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:82:13: error: reference to 'cin' is ambiguous
             cin >> s >> b;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:87:13: error: reference to 'cin' is ambiguous
             cin >> s;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:89:13: error: reference to 'cin' is ambiguous
             cin >> s >> b;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:94:13: error: reference to 'cin' is ambiguous
             cin >> s;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.cpp:1:
/usr/include/c++/4.8/iostream:61:18: note:                 std::ostream std::cout
   extern ostream cout;  /// Linked to standard output
                  ^
ecuatie2.cpp:96:13: error: reference to 'cin' is ambiguous
             cin >> s >> b;

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

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

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

          ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0,
                 from ecuatie2.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 ecuatie2 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ă.