Bangla Numbers

 avatar
user_6817964
c_cpp
2 years ago
1.5 kB
1
Indexable
Never
#include <iostream>
using namespace std;

main(){
    long long int x;
    int num = 0;

    while(cin >> x){
        cout << "  ";
        num++;
        if(num < 10){
            cout << " ";
        }
        cout << num << ". ";
        if(x == 0)
            cout << 0;


        if(x/1000000000 != 0){
            int xx = x/1000000000;
            if(xx/100000 != 0){
                cout << xx/100000 << " kuti ";
                xx %= 100000;
            }
            if(xx/1000 != 0){
                cout << xx/1000 << " lakh ";
                xx %= 1000;
            }
            if(xx/10 != 0){
                cout << xx/10 << " hajar ";
                xx %= 10;
            }
            if(xx != 0){
                cout << xx << " shata ";
            }
            x %= 1000000000;
            if(x/10000000 == 0){
                cout << "kuti";
            }
        }


        if(x/10000000 != 0){
            cout << x/10000000 << " kuti";
            x %= 10000000;
        }
        if(x/100000 != 0){
            cout << " " << x/100000 << " lakh ";
            x %= 100000;
        }
        if(x/1000 != 0){
            cout << x/1000 << " hajar ";
            x %= 1000;
        }
        if(x/100 != 0){
            cout << x/100 << " shata ";
            x %= 100;
        }
        if(x != 0){
            cout << x;
        }
        cout << endl;
    }
}