Advertisement
Zinak

zeros

Aug 22nd, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. ll k =1e7, l =1e5, h =1e3, s= 100;
  5. void calc(ll n)
  6. {
  7.     if(n/k >0)
  8.     {
  9.         calc(n/k);
  10.         cout<<" kuti",n%=k;
  11.     }
  12.     if(n/l >0)
  13.         cout<<" "<<n/l<<" "<<"lakh",n%=l;
  14.     if(n/1000 >0)
  15.         cout<<" "<<n/h<<" "<<"hajar",n%=h;
  16.     if(n/100 >0)
  17.         cout<<" "<<n/s<<" "<<"shata",n%=s;
  18.     if(n!=0)
  19.         cout<<" "<<n;
  20. }
  21. int main()
  22. {
  23.     ll n,i=0;
  24.     while(cin>>n)
  25.     {
  26.        cout<<++i<<".";
  27.         if(n== 0)
  28.             cout<<" "<<0;
  29.         else
  30.             calc(n);
  31.         cout<<endl;
  32.     }
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement