Detalii evaluare #64840283

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 #64840283 Utilizator Ştefana Daminescu (stefana_daminescu)
Fișier maxmin.cpp Dimensiune 305 B
Data încărcării 05 Iunie 2026, 16:10 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

maxmin.cpp: In function ‘int main()’:
maxmin.cpp:7:5: error: reference to ‘min’ is ambiguous
    7 |     min = a;
      |     ^~~
In file included from /usr/include/c++/13/string:51,
                 from /usr/include/c++/13/bits/locale_classes.h:40,
                 from /usr/include/c++/13/bits/ios_base.h:41,
                 from /usr/include/c++/13/ios:44,
                 from /usr/include/c++/13/ostream:40,
                 from /usr/include/c++/13/iostream:41,
                 from maxmin.cpp:1:
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:                 ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:14: note:                 ‘int min’
    3 | int a,b,c,mm,min,max;
      |              ^~~
maxmin.cpp:8:5: error: reference to ‘max’ is ambiguous
    8 |     max = a;
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:                 ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:18: note:                 ‘int max’
    3 | int a,b,c,mm,min,max;
      |                  ^~~
maxmin.cpp:9:9: error: reference to ‘max’ is ambiguous
    9 |     if (max < b) max = b;
      |         ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:                 ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:18: note:                 ‘int max’
    3 | int a,b,c,mm,min,max;
      |                  ^~~
maxmin.cpp:9:18: error: reference to ‘max’ is ambiguous
    9 |     if (max < b) max = b;
      |                  ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:                 ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:18: note:                 ‘int max’
    3 | int a,b,c,mm,min,max;
      |                  ^~~
maxmin.cpp:10:9: error: reference to ‘max’ is ambiguous
   10 |     if (max < c) max = c;
      |         ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:                 ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:18: note:                 ‘int max’
    3 | int a,b,c,mm,min,max;
      |                  ^~~
maxmin.cpp:10:18: error: reference to ‘max’ is ambiguous
   10 |     if (max < c) max = c;
      |                  ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:                 ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:18: note:                 ‘int max’
    3 | int a,b,c,mm,min,max;
      |                  ^~~
maxmin.cpp:11:9: error: reference to ‘min’ is ambiguous
   11 |     if (min > b) min = b;
      |         ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:                 ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:14: note:                 ‘int min’
    3 | int a,b,c,mm,min,max;
      |              ^~~
maxmin.cpp:11:18: error: reference to ‘min’ is ambiguous
   11 |     if (min > b) min = b;
      |                  ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:                 ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:14: note:                 ‘int min’
    3 | int a,b,c,mm,min,max;
      |              ^~~
maxmin.cpp:12:9: error: reference to ‘min’ is ambiguous
   12 |     if (min > c) min = c;
      |         ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:                 ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:14: note:                 ‘int min’
    3 | int a,b,c,mm,min,max;
      |              ^~~
maxmin.cpp:12:18: error: reference to ‘min’ is ambiguous
   12 |     if (min > c) min = c;
      |                  ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:                 ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:14: note:                 ‘int min’
    3 | int a,b,c,mm,min,max;
      |              ^~~
maxmin.cpp:13:10: error: reference to ‘max’ is ambiguous
   13 |     mm = max - min;
      |          ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note:                 ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:18: note:                 ‘int max’
    3 | int a,b,c,mm,min,max;
      |                  ^~~
maxmin.cpp:13:16: error: reference to ‘min’ is ambiguous
   13 |     mm = max - min;
      |                ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:                 ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
maxmin.cpp:3:14: note:                 ‘int min’
    3 | int a,b,c,mm,min,max;
      |              ^~~

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!