#2859
TreiCifImp
C++
Să se scrie o funcție C++ care primește ca parametru un număr natural n
și returnează 1
dacă n
conține cel puțin trei cifre alăturate impare, sau returnează 0
în caz contrar.
Problema | TreiCifImp | Operații I/O |
treicifimp.in /treicifimp.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54236879 | Utilizator | |
Fișier | treicifimp.cpp | Dimensiune | 534 B |
Data încărcării | 23 Noiembrie 2024, 00:35 | Scor / rezultat | Eroare de compilare |
treicifimp.cpp: In function 'int TreiCifImp(int)': treicifimp.cpp:7:21: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p == "1" && n % p == "3" && n % p == "5" && n % p == "7" && n % p == "9"){ ^ treicifimp.cpp:7:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:7:37: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p == "1" && n % p == "3" && n % p == "5" && n % p == "7" && n % p == "9"){ ^ treicifimp.cpp:7:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:7:53: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p == "1" && n % p == "3" && n % p == "5" && n % p == "7" && n % p == "9"){ ^ treicifimp.cpp:7:53: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:7:69: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p == "1" && n % p == "3" && n % p == "5" && n % p == "7" && n % p == "9"){ ^ treicifimp.cpp:7:69: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:7:85: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p == "1" && n % p == "3" && n % p == "5" && n % p == "7" && n % p == "9"){ ^ treicifimp.cpp:7:85: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:8:30: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 10 == "1" && n % p * 10 == "3" && n % p * 10 == "5" && n % p * 10 == "7" && n % p * 10 == "9"){ ^ treicifimp.cpp:8:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:8:51: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 10 == "1" && n % p * 10 == "3" && n % p * 10 == "5" && n % p * 10 == "7" && n % p * 10 == "9"){ ^ treicifimp.cpp:8:51: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:8:72: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 10 == "1" && n % p * 10 == "3" && n % p * 10 == "5" && n % p * 10 == "7" && n % p * 10 == "9"){ ^ treicifimp.cpp:8:72: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:8:93: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 10 == "1" && n % p * 10 == "3" && n % p * 10 == "5" && n % p * 10 == "7" && n % p * 10 == "9"){ ^ treicifimp.cpp:8:93: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:8:114: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 10 == "1" && n % p * 10 == "3" && n % p * 10 == "5" && n % p * 10 == "7" && n % p * 10 == "9"){ ^ treicifimp.cpp:8:114: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:9:35: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 100 == "1" && n % p * 100 == "3" && n % p * 100 == "5" && n % p * 100 == "7" && n % p * 100 == "9"){ ^ treicifimp.cpp:9:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:9:57: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 100 == "1" && n % p * 100 == "3" && n % p * 100 == "5" && n % p * 100 == "7" && n % p * 100 == "9"){ ^ treicifimp.cpp:9:57: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:9:79: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 100 == "1" && n % p * 100 == "3" && n % p * 100 == "5" && n % p * 100 == "7" && n % p * 100 == "9"){ ^ treicifimp.cpp:9:79: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:9:101: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 100 == "1" && n % p * 100 == "3" && n % p * 100 == "5" && n % p * 100 == "7" && n % p * 100 == "9"){ ^ treicifimp.cpp:9:101: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] treicifimp.cpp:9:123: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(n % p * 100 == "1" && n % p * 100 == "3" && n % p * 100 == "5" && n % p * 100 == "7" && n % p * 100 == "9"){ ^ treicifimp.cpp:9:123: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema TreiCifImp 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ă.