Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- ifstream fin("numere.in");
- ofstream fout("numere.out");
- int v[1000000];
- int main()
- {
- int x10, r=0, c=0, i;
- fin>>x10;
- for(i=1; x10!=0; i++)
- {
- r=x10%20;
- v[i]=r;
- x10=x10/20;
- }
- for(c=i-1; c>=1; c--)
- {
- if(v[c]==0)
- {
- fout<<0;
- }
- while(v[c]>=5)
- {
- fout<<5;
- v[c]-=5;
- }
- while(v[c])
- {
- fout<<1;
- v[c]--;
- }
- fout<<' ';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment