UVa10101

題目:
https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1042

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

void printBangla(unsigned long long int n){
if(n >= 10000000){
printBangla(n/10000000);
cout << " kuti";
n %= 10000000;
}
if(n >= 100000){
printBangla(n/100000);
cout << " lakh";
n %= 100000;
}
if(n >= 1000){
printBangla(n/1000);
cout << " hajar";
n %= 1000;
}
if(n >= 100){
printBangla(n/100);
cout << " shata";
n %= 100;
}
if(n > 0){
cout << ' ' << n;
}
}

int main(){
vector<string> ans;
unsigned long long int num;
int cases = 1;
while(cin >> num){
ans.clear();
printf("%4d.", cases);
if(num == 0) cout << " 0";
else printBangla(num);
cout << '\n';
++cases;
}
return 0;
}