Detalii evaluare #53772212

Rezumat problemă

Să se scrie un program care citeşte din fişier două numere întregi şi determină suma lor.

Detalii

Problema sum Operații I/O sum.in/sum.out
Limita timp 1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #53772212 Utilizator Trâmbițaș Alexandru-Luca (Alex_Tr123)
Fișier sum.cpp Dimensiune 1.23 KB
Data încărcării 11 Noiembrie 2024, 13:18 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

sum.cpp: In function 'long double distX(punct, punct, punct)':
sum.cpp:36:44: error: call of overloaded 'abs(long double)' is ambiguous
     double long dist = 1.0*abs(xp - 1.0*p.x);

                                            ^
sum.cpp:36:44: note: candidates are:
In file included from /usr/include/c++/4.8/cstdlib:72:0,
                 from /usr/include/c++/4.8/ext/string_conversions.h:41,
                 from /usr/include/c++/4.8/bits/basic_string.h:2815,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from sum.cpp:1:
/usr/include/stdlib.h:775:12: note: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^
In file included from /usr/include/c++/4.8/ext/string_conversions.h:41:0,
                 from /usr/include/c++/4.8/bits/basic_string.h:2815,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from sum.cpp:1:
/usr/include/c++/4.8/cstdlib:174:3: note: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
/usr/include/c++/4.8/cstdlib:166:3: note: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^
sum.cpp: In function 'long double distY(punct, punct, punct)':
sum.cpp:51:44: error: call of overloaded 'abs(long double)' is ambiguous
     double long dist = 1.0*abs(yp - 1.0*p.y);

                                            ^
sum.cpp:51:44: note: candidates are:
In file included from /usr/include/c++/4.8/cstdlib:72:0,
                 from /usr/include/c++/4.8/ext/string_conversions.h:41,
                 from /usr/include/c++/4.8/bits/basic_string.h:2815,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from sum.cpp:1:
/usr/include/stdlib.h:775:12: note: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^
In file included from /usr/include/c++/4.8/ext/string_conversions.h:41:0,
                 from /usr/include/c++/4.8/bits/basic_string.h:2815,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from sum.cpp:1:
/usr/include/c++/4.8/cstdlib:174:3: note: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
/usr/include/c++/4.8/cstdlib:166:3: note: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^
sum.cpp: In function 'int main()':
sum.cpp:65:53: warning: narrowing conversion of 'x1' from 'int' to 'double' inside { } [-Wnarrowing]
         trg.push_back({{x1, y1}, {x2, y2}, {x3, y3}});

                                                     ^
sum.cpp:65:53: warning: narrowing conversion of 'y1' from 'int' to 'double' inside { } [-Wnarrowing]
sum.cpp:65:53: warning: narrowing conversion of 'x2' from 'int' to 'double' inside { } [-Wnarrowing]
sum.cpp:65:53: warning: narrowing conversion of 'y2' from 'int' to 'double' inside { } [-Wnarrowing]
sum.cpp:65:53: warning: narrowing conversion of 'x3' from 'int' to 'double' inside { } [-Wnarrowing]
sum.cpp:65:53: warning: narrowing conversion of 'y3' from 'int' to 'double' inside { } [-Wnarrowing]

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