#3160
Se citesc un număr natural n având cifrele diferite două câte două și o cifră c. Afișați în ordine descrescătoare numerele formate din c cifre distincte care se pot obține din cifrele lui n și care au cifrele ordonate crescător.
| Problema | cifre_c | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63502694 | Utilizator | |
| Fișier | cifre_c.cpp | Dimensiune | 938 B |
| Data încărcării | 05 Martie 2026, 23:57 | Scor/rezultat | Eroare de compilare |
cifre_c.cpp:4:11: error: conflicting declaration 'int n' int n[10],n,c,v[15]; ^ cifre_c.cpp:4:5: error: 'n' has a previous declaration as 'int n [10]' int n[10],n,c,v[15]; ^ cifre_c.cpp: In function 'void Read()': cifre_c.cpp:9:10: error: cannot bind 'std::istream {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&' cin>>n>>c; ^ In file included from /usr/include/c++/4.8/iostream:40:0, from cifre_c.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = int [10]]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ cifre_c.cpp:10:11: warning: the address of 'n' will always evaluate as 'true' [-Waddress] while(n) ^ cifre_c.cpp:12:18: error: invalid operands of types 'int [10]' and 'int' to binary 'operator%' v[++i]=n%10; ^ cifre_c.cpp:13:13: error: invalid operands of types 'int [10]' and 'int' to binary 'operator/' n=n/10; ^ cifre_c.cpp:15:6: error: incompatible types in assignment of 'int' to 'int [10]' n=i; ^ cifre_c.cpp:16:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(i=1;i<n;i++) ^ cifre_c.cpp:17:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(j=i+1;j<=n;j++) ^ cifre_c.cpp: In function 'void Display()': cifre_c.cpp:26:15: error: 'x' was not declared in this scope cout<<x[i]; ^ cifre_c.cpp: In function 'int Valid(int)': cifre_c.cpp:33:8: error: 'x' was not declared in this scope if(x[1]==0) ^ cifre_c.cpp:37:12: error: 'x' was not declared in this scope if(x[i]==x[k]) ^ cifre_c.cpp:39:12: error: 'x' was not declared in this scope if(x[i]>x[i+1]) ^ cifre_c.cpp: In function 'void Backtracking(int)': cifre_c.cpp:52:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(i=1;i<=n;i++) ^ cifre_c.cpp:54:13: error: 'x' was not declared in this scope x[k]=v[i]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cifre_c 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ă.