Detalii evaluare #11820027

Rezumat problemă

Să se scrie un program care citeşte de la tastatură trei numere naturale și determină diferenţa dintre cel mai mare şi cel mai mic.

Detalii

Problema maxmin Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #11820027 Utilizator Giurea Ana (ANAGIUREAmihaela)
Fișier maxmin.cpp Dimensiune 349 B
Data încărcării 10 Noiembrie 2018, 21:14 Scor / rezultat Eroare de compilare

Evaluare

Mesaj compilare

maxmin.cpp: In function 'int main()':
maxmin.cpp:7:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int')
     if(a>b&&a>c&&b>c) cout << a-c=mm;

                                  ^
maxmin.cpp:7:34: note: candidate is:
In file included from /usr/include/c++/4.8/iostream:39:0,
                 from maxmin.cpp:1:
/usr/include/c++/4.8/ostream:58:11: note: std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&) <deleted>
     class basic_ostream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.8/ostream:58:11: note:   no known conversion for argument 1 from 'long long int' to 'const std::basic_ostream<char>&'
maxmin.cpp:8:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int')
     if(a>b&&a>c&&c>b) cout << a-b=mm;

                                  ^
maxmin.cpp:8:34: note: candidate is:
In file included from /usr/include/c++/4.8/iostream:39:0,
                 from maxmin.cpp:1:
/usr/include/c++/4.8/ostream:58:11: note: std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&) <deleted>
     class basic_ostream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.8/ostream:58:11: note:   no known conversion for argument 1 from 'long long int' to 'const std::basic_ostream<char>&'
maxmin.cpp:9:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int')
     if(b>c&&b>a&&c>a) cout << b-a=mm;

                                  ^
maxmin.cpp:9:34: note: candidate is:
In file included from /usr/include/c++/4.8/iostream:39:0,
                 from maxmin.cpp:1:
/usr/include/c++/4.8/ostream:58:11: note: std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&) <deleted>
     class basic_ostream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.8/ostream:58:11: note:   no known conversion for argument 1 from 'long long int' to 'const std::basic_ostream<char>&'
maxmin.cpp:10:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int')
     if(b>c&&b>a&&a>c) cout << b-c=mm;

                                  ^
maxmin.cpp:10:34: note: candidate is:
In file included from /usr/include/c++/4.8/iostream:39:0,
                 from maxmin.cpp:1:
/usr/include/c++/4.8/ostream:58:11: note: std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&) <deleted>
     class basic_ostream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.8/ostream:58:11: note:   no known conversion for argument 1 from 'long long int' to 'const std::basic_ostream<char>&'
maxmin.cpp:11:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int')
     if(c>a&&c>b&&a>b) cout << c-b=mm;

                                  ^
maxmin.cpp:11:34: note: candidate is:
In file included from /usr/include/c++/4.8/iostream:39:0,
                 from maxmin.cpp:1:
/usr/include/c++/4.8/ostream:58:11: note: std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&) <deleted>
     class basic_ostream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.8/ostream:58:11: note:   no known conversion for argument 1 from 'long long int' to 'const std::basic_ostream<char>&'
maxmin.cpp:12:34: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>::__ostream_type {aka std::basic_ostream<char>}' and 'long long int')
     if(c>a&&c>b&&b>a) cout << c-a=mm;

                                  ^
maxmin.cpp:12:34: note: candidate is:
In file included from /usr/include/c++/4.8/iostream:39:0,
                 from maxmin.cpp:1:
/usr/include/c++/4.8/ostream:58:11: note: std::basic_ostream<char>& std::basic_ostream<char>::operator=(const std::basic_ostream<char>&) <deleted>
     class basic_ostream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.8/ostream:58:11: note:   no known conversion for argument 1 from 'long long int' to 'const std::basic_ostream<char>&'

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

Du-te sus!