-
Notifications
You must be signed in to change notification settings - Fork 14
/
10101.cpp
39 lines (39 loc) · 1.87 KB
/
10101.cpp
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
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
long long val,test=1;
while(scanf("%ld",&val)!=EOF){
string master[]={" kuti", " lakh", " hajar", " shata", " kuti", " lakh", " hajar", " shata", ""};
long long n=val;
long long num[9]={0};
num[8]=n%100; n/=100;
// if(n==0) goto XXX;
num[7]=n%10; n/=10;
// if(n==0) goto XXX;
num[6]=n%100; n/=100;
// if(n==0) goto XXX;
num[5]=n%100; n/=100;
// if(n==0) goto XXX;
num[4]=n%100; n/=100;
// if(n==0) goto XXX;
num[3]=n%10; n/=10;
// if(n==0) goto XXX;
num[2]=n%100; n/=100;
// if(n==0) goto XXX;
num[1]=n%100; n/=100;
// if(n==0) goto XXX;
num[0]=n%100; n/=100;
int i=0;
while(num[i]==0) i++;
printf("%4d.",test++);
for(i=0;i<9;i++){
if(num[i]!=0)
cout<<" "<<num[i]<<master[i];
}
printf("\n");
}
return 0;
}