#3412
IIF
C++
Redefiniți instruțiunea condițională if
, printr-o secvență de directive #define
.
Problema | IIF | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57929511 | Utilizator | |
Fișier | iif.cpp | Dimensiune | 494 B |
Data încărcării | 02 Mai 2025, 17:23 | Scor / rezultat | Eroare de compilare |
iif.cpp: In function 'int main()': iif.cpp:8:10: error: invalid conversion from 'const char*' to 'int' [-fpermissive] v[0] = (a); \ ^ iif.cpp:38:6: note: in expansion of macro 'CHECK' if(CHECK(0, "this is ONE", 10)==10) total++; ^ iif.cpp:8:10: error: invalid conversion from 'const char*' to 'int' [-fpermissive] v[0] = (a); \ ^ iif.cpp:39: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:9:10: error: invalid conversion from 'const char*' to 'int' [-fpermissive] v[1] = (b); \ ^ iif.cpp:39: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:14:6: error: invalid conversion from 'int' to 'const char*' [-fpermissive] x;\ ^ iif.cpp:39: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 /usr/include/c++/4.8/cstring:42:0, from iif.cpp:3: /usr/include/string.h:144:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^
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ă.