#3412
IIF
C++
Redefiniți instruțiunea condițională if
, printr-o secvență de directive #define
.
Problema | IIF | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #43959881 | Utilizator | |
Fișier | iif.cpp | Dimensiune | 96 B |
Data încărcării | 31 Mai 2023, 20:28 | Scor / rezultat | Eroare de compilare |
iif.cpp: In function 'int main()': iif.cpp:5:56: error: 'cout' was not declared in this scope #define CHECK(check, check_true, check_false) (check ? cout << check_true : cout << check_false) ^ iif.cpp:14:6: note: in expansion of macro 'CHECK' if(CHECK(0, "this is ONE", 10)==10) total++; ^ iif.cpp:5:56: note: suggested alternative: #define CHECK(check, check_true, check_false) (check ? cout << check_true : cout << check_false) ^ iif.cpp:14:6: note: in expansion of macro 'CHECK' if(CHECK(0, "this is ONE", 10)==10) total++; ^ In file included from iif.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ iif.cpp:5:56: error: 'cout' was not declared in this scope #define CHECK(check, check_true, check_false) (check ? cout << check_true : cout << check_false) ^ iif.cpp:15:13: note: in expansion of macro 'CHECK' if(strcmp(CHECK(1, "this will not be returned", "but this will"), "this will not be returned")==0) total++; ^ iif.cpp:5:56: note: suggested alternative: #define CHECK(check, check_true, check_false) (check ? cout << check_true : cout << check_false) ^ iif.cpp:15:13: note: in expansion of macro 'CHECK' if(strcmp(CHECK(1, "this will not be returned", "but this will"), "this will not be returned")==0) total++; ^ In file included from iif.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema IIF face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. Soluția propusă de tine va fi evaluată astfel:
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ă.