#3159
Se citesc un număr natural n având cifrele diferite două câte două și o cifră c. Afișați în ordine crescătoare numerele formate din c cifre distincte care se pot obține din cifrele lui n.
| Problema | numere124 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.4 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64294807 | Utilizator | |
| Fișier | numere124.cpp | Dimensiune | 845 B |
| Data încărcării | 28 Aprilie 2026, 12:47 | Scor/rezultat | Eroare de compilare |
numere124.cpp: In function ‘void Back(int)’: numere124.cpp:30:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 30 | if(OK(k)) | ^ numere124.cpp: In function ‘int main()’: numere124.cpp:39:11: error: ‘nr’ was not declared in this scope; did you mean ‘n’? 39 | while(nr!=0) | ^~ | n numere124.cpp:40:11: error: expected ‘]’ before ‘}’ token 40 | {a[++n}=nr%10; | ^ | ] numere124.cpp:40:11: error: expected ‘;’ before ‘}’ token 40 | {a[++n}=nr%10; | ^ | ; numere124.cpp:40:12: error: expected primary-expression before ‘=’ token 40 | {a[++n}=nr%10; | ^ numere124.cpp:40:13: error: ‘nr’ was not declared in this scope; did you mean ‘n’? 40 | {a[++n}=nr%10; | ^~ | n numere124.cpp: At global scope: numere124.cpp:42:8: error: expected unqualified-id before ‘for’ 42 | for(int i=1;i<=n;i++) | ^~~ numere124.cpp:42:20: error: ‘i’ does not name a type 42 | for(int i=1;i<=n;i++) | ^ numere124.cpp:42:25: error: ‘i’ does not name a type 42 | for(int i=1;i<=n;i++) | ^ numere124.cpp:43:22: error: ‘j’ does not name a type 43 | for(int j=i+1;j<=n;j++) | ^ numere124.cpp:43:27: error: ‘j’ does not name a type 43 | for(int j=i+1;j<=n;j++) | ^ numere124.cpp:48:9: error: expected constructor, destructor, or type conversion before ‘(’ token 48 | Back(1); | ^ numere124.cpp:49:5: error: expected unqualified-id before ‘return’ 49 | return 0; | ^~~~~~ numere124.cpp:50:1: error: expected declaration before ‘}’ token 50 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema numere124 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ă.