#447
Se citește de la tastatură un număr natural de 3 cifre, distincte. Să se afișeze pe ecran cifra din mijloc, ca valoare.
| Problema | cifmid | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64972630 | Utilizator | |
| Fișier | cifmid.cpp | Dimensiune | 317 B |
| Data încărcării | 30 Iunie 2026, 11:08 | Scor/rezultat | 0 puncte |
cifmid.cpp: In function ‘int main()’: cifmid.cpp:9:22: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 9 | if((a==n/100)<(b==n%10)%10<c==n%10) | ~~~~~~~~~~^~~~~~~~~~~~~ cifmid.cpp:9:35: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 9 | if((a==n/100)<(b==n%10)%10<c==n%10) | ~~~~~~~~~~~~~~~~~~~~~~~^~ cifmid.cpp:13:26: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 13 | else if((c==n%10)<(a==n/100)<b==(n%10)%10) | ~~~~~~~~~^~~~~~~~~~~ cifmid.cpp:13:37: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses] 13 | else if((c==n%10)<(a==n/100)<b==(n%10)%10) | ~~~~~~~~~~~~~~~~~~~~^~ cifmid.cpp:17:29: warning: comparisons like ‘X<=Y<=Z’ do not have their mathematical meaning [-Wparentheses] 17 | else if((b==n%10)%10<(c==n%10)<(a==n/100)) | ~~~~~~~~~~~~^~~~~~~~~~ cifmid.cpp:9:14: warning: ‘a’ is used uninitialized [-Wuninitialized] 9 | if((a==n/100)<(b==n%10)%10<c==n%10) | ~~^~~~~~~~ cifmid.cpp:6:13: note: ‘a’ was declared here 6 | int a,b,c,n; | ^ cifmid.cpp:9:35: warning: ‘c’ is used uninitialized [-Wuninitialized] 9 | if((a==n/100)<(b==n%10)%10<c==n%10) | ~~~~~~~~~~~~~~~~~~~~~~~^~ cifmid.cpp:6:17: note: ‘c’ was declared here 6 | int a,b,c,n; | ^ cifmid.cpp:11:19: warning: ‘b’ may be used uninitialized [-Wmaybe-uninitialized] 11 | cout<<b; | ^ cifmid.cpp:6:15: note: ‘b’ was declared here 6 | int a,b,c,n; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.002 secunde | Raspuns gresit. | 20 | 0 | ||
| 3 | 0.002 secunde | Raspuns gresit. | 20 | 0 | ||
| 4 | 0.002 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.002 secunde | Raspuns gresit. | 20 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cifmid face parte din prima categorie. 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ă.