Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Se citeste un nr n de la taste, afisati in ordine descrescatoare cifrele numarului, o singura data.
- using namespace std;
- int main()
- {
- int n,cif,i,nn;
- cout<<"n=";
- cin>>n;
- for(i=9;i>=0;i--)
- {
- nn=n;
- while(nn!=0)
- {
- cif=nn%10;
- nn=nn/10;
- if ( cif==i)
- cout<<i;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement