#4699
Subprogramul moderat are un singur parametru, n, prin care primește un număr natural (n ∈ [1, 1.000.000.000]). Subprogramul returnează valoarea 1 dacă n este un număr moderat, sau valoarea 0 în caz contrar. Scrieți definiția completă a subprogramului.
Bac 2024, sesiunea august
| Problema | moderat | Operații I/O |
moderat.in/moderat.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
| Id soluție | #64618668 | Utilizator | |
| Fișier | moderat.cpp | Dimensiune | 529 B |
| Data încărcării | 18 Mai 2026, 21:41 | Scor/rezultat | 0 puncte |
moderat.cpp: In function ‘int Moderat(int)’: moderat.cpp:40:13: warning: ‘p2’ may be used uninitialized [-Wmaybe-uninitialized] 40 | return p1*p2; | ^~ moderat.cpp:27:10: note: ‘p2’ was declared here 27 | int p1,p2; | ^~ In function ‘int Moderat(int)’, inlined from ‘int main()’ at moderat.cpp:49:26: moderat.cpp:40:13: warning: ‘p2’ may be used uninitialized [-Wmaybe-uninitialized] 40 | return p1*p2; | ^~ moderat.cpp: In function ‘int main()’: moderat.cpp:27:10: note: ‘p2’ was declared here 27 | int p1,p2; | ^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | Raspuns gresit. | 10 | 0 | ||
| 2 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 3 | 0.004 secunde | Raspuns gresit. | 20 | 0 | ||
| 4 | 0.003 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.003 secunde | Raspuns gresit. | 20 | 0 | ||
| 6 | 0.006 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema moderat 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ă.