## 10101 - Bangla Numbers

Moderator: Board moderators

### Re: 10101 - Bangla Numbers

Accepted.

lnr
Experienced poster

Posts: 134
Joined: Sat Jun 30, 2007 2:52 pm

### Re:

Ahmed Shamsul Arefin wrote:You r a donky man! It's a Bangal magic
you can't find

Kut(t)i thakle kikore programer vul paba ... my frd
try folllowing input case.[beta to PE O dei, jak kut(t)ir hat hote pacha geche]

Code: Select all
`900000000078467900000000078000900000000000000101010101010101010101010101010100000000000001 23764458970089739589999999999999992003400000008890000000000000.00      909003  `

Output :
Code: Select all
`   1. 9 kuti kuti 78 hajar 4 shata 67   2. 9 kuti kuti 78 hajar   3. 9 kuti kuti   4. 1 kuti 1 lakh 1 hajar 10 kuti 10 lakh 10 hajar 1 shata 1   5. 10 lakh 10 hajar 1 shata 1 kuti 1 lakh 1 hajar 10   6. 1 kuti kuti 1   7. 23 hajar 7 shata 64   8. 45 lakh 89 hajar 7 shata kuti 89 lakh 73 hajar 9 shata 58   9. 9 kuti 99 lakh 99 hajar 9 shata 99 kuti 99 lakh 99 hajar 9 shata 99  10. 20 hajar 34  11. 88  12. 9 shata kuti  13. 0  14. 90  15. 9 hajar 3`
Rizoan toufiq
New poster

Posts: 5
Joined: Mon Apr 21, 2008 9:38 pm

### Re: 10101 - Bangla Numbers

WHY MY CODE is taken as WA when it generates all correct answers??

#include <stdio.h>

int main()
{
int l,k[16],j;
unsigned long long i,p,a,b,c,x,y,z;

while(scanf("%llu",&i)==1)
{
l=0;

p=i;

for(j=0;j<15;j++)
{
k[j]=i%10;
l++;
i/=10;
if(i==0)break;
}

a=p-(p%100000);
b=p-(p%1000);
c=p-(p%100);
x=p-(p%1000000000000);
y=p-(p%10000000000);
z=p-(p%1000000000);

for(j=l-1;j>=0;j--)
{
if((j==13 && k[13]==0)||(j==12 && k[13]==0 && k[12]==0))continue;
else if((j==11 && k[11]==0)||(j==10 && k[11]==0 && k[10]==0))continue;
else if((j==9 && k[9]==0)||(j==8 && k[8]==0))continue;
else if((j==7 && k[8]==0 && k[7]==0)){printf("kuti ");continue;}
else if((j==6 && k[6]==0)||(j==5 && (k[6]==0 && k[5]==0)))continue;
else if((j==4 && k[4]==0)||(j==3 && k[4]==0 && k[3]==0))continue;
else if((j==2 && k[2]==0)||(j==1 && k[1]==0)||(j==0 && k[1]==0 && k[0]==0))continue;

printf("%d",k[j]);
if(l==15 && j==14)printf(" kuti ");
if(l>12 && j==12 && x%100000000000000!=0)printf(" lakh ");
if(l>10 && j==10 && y%1000000000000!=0 )printf(" hajar ");
if(l>9 && j==9 && z%100000000000!=0)printf(" shata ");
if(l>7 && j==7)printf(" kuti ");
if(l>5 && j==5 && a%10000000!=0)printf(" lakh ");
if(l>3 && j==3 && b%100000!=0)printf(" hajar ");
if(l>2 && j==2 && c%1000!=0)printf(" shata ");
}
printf("\n");

}

return 0;
}
sami001
New poster

Posts: 3
Joined: Thu Jun 17, 2010 5:19 pm

### Re: 10101 - Bangla Numbers

why PE ??? can't understand.....here is my code

get AC thnx.....
Last edited by shuza on Tue May 08, 2012 5:44 pm, edited 1 time in total.
shuza
New poster

Posts: 4
Joined: Fri May 04, 2012 1:59 am

### Re: 10101 - Bangla Numbers

Use %4d for the case number.
brianfry713
Guru

Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 10101 - Bangla Numbers

I am getting W A. Why?
Code: Select all
`/* Removed after AC */`
uvasarker
Learning poster

Posts: 96
Joined: Tue Jul 19, 2011 12:19 pm

### Why WA again n again ?? : 10101 - Bangla Numbers

um getting WA again and again ,,,, heres my code ...... plz help me ..... plz.......
code :

#include<stdio.h>

int main()
{

long long int num;
int i=0;
while(scanf("%lld",&num)==1)
{
long long a,b,c,d,e,f,g,h;
i++;
a=num /100000000000000;
num=num %100000000000000;
b=num/1000000000000;
num=num%1000000000000;
c=num/10000000000;
num=num%10000000000;
d=num/1000000000;
num=num%1000000000;
e=num/10000000;
num=num%10000000;
f=num/100000;
num=num%100000;
g=num/1000;
num=num%1000;
h=num/100;
num=num%100;
printf("%4d.",i);
if(a!=0)
printf(" %lld kuti",a);
if(b!=0)
printf(" %lld lakh", b);
if(c!=0)
printf(" %lld hajar",c);
if(d!=0)
printf(" %lld shata",d);
if(e!=0)
printf(" %lld kuti",e);
else if(e==0&&(a!=0||b!=0||c!=0||d!=0))
printf(" kuti");
if(f!=0)
printf(" %lld lakh", f);
if(g!=0)
printf(" %lld hajar",g);
if(h!=0)
printf(" %lld shata",h);
if(num!=0)
printf(" %lld",num);
printf("\n");

}
return 0;
}

plz reply me where d prob in my code ,,, and give me critical I/O plz
sonjbond
New poster

Posts: 18
Joined: Wed Jul 04, 2012 10:30 pm

### Re: 10101 - Bangla Numbers

Try an input of 0.
brianfry713
Guru

Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 10101 - Bangla Numbers

output is 0 for the input 0 , shouldnt it ?? plz check my code again and help me ...........
sonjbond
New poster

Posts: 18
Joined: Wed Jul 04, 2012 10:30 pm

### Re: 10101 - Bangla Numbers

For input:
Code: Select all
`0`
Ac output is
Code: Select all
`   1. 0`
Code: Select all
`   1.`
brianfry713
Guru

Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

### Re: 10101 - Bangla Numbers

I have tried a lot of input but again it is showing Runtime error ( RE ).
for input 0 it is showing 0

#include<stdio.h>
int main()
{
unsigned long long int num,cas,a,b,c,i,j,k,l,n,d,e,f,g[2000],h,m[2000];
m[0]=0,m[1]=0,m[2]=0,m[3]=0,m[4]=0,m[5]=0,m[6]=0,m[7]=0,m[8]=0,m[9]=0,m[10]=0;
int t;
t=1;

while(scanf("%lld",&num)==1)
{
e=0;
if(num==0)
printf("%d. %lld",t,e);
else
{

while(num!=0)
{
a=num/100;
b=num%100;
m[e]=b;
num=a;
e++;
a=num/10;
b=num%10;
m[e]=b;
num=a;
e++;
a=num/100;
b=num%100;
m[e]=b;
num=a;
e++;
a=num/100;
b=num%100;
m[e]=b;
num=a;
e++;

}
n=1;

for(d=0;d<=e-1;d++)
{
g[n]=m[d];
n++;

}

if(e==12)
n=n-1;
for(h=n-1;h>=1;h--)
{
if(g[h]!=0 );
}
printf("%d. ",t);

for(i=n-1;i>=1;i--)
{
{
if(g[i]!=0 && i==9)
{
if(g[i]!=0 && i==9 && g[8]==0 && g[7]==0 && g[6]==0 && g[5]==0)
{
printf("%lld kuti kuti ",g[i]);
}
else
printf("%lld kuti ",g[i]);
}
else if(g[i]!=0 && i==8 )
{
if(g[7]==0 && g[6]==0 && g[5]==0)
{
printf("%lld lakh kuti ",g[i]);
}
else
printf("%lld lukh ",g[i]);
}
else if(g[i]!=0 && i==7)
{
if(g[6]==0 && g[5]==0)
{
printf("%lld hajar kuti ",g[i]);
}
else
printf("%lld hajar ",g[i]);
}
else if(g[i]!=0 && i==6)
{
if(g[5]==0)
{
printf("%lld shata kuti ",g[i]);
}
else
printf("%lld shata ",g[i]);
}
else if(g[i]!=0 && i==5)
{
printf("%lld kuti ",g[i]);
}
else if(g[i]!=0 && i==4)
{
printf("%lld lukh ",g[i]);
}
else if(g[i]!=0 && i==3)
{
printf("%lld hajar ",g[i]);
}
else if(g[i]!=0 && i==2)
{
printf("%lld shata ",g[i]);
}
else if(g[i]!=0 && i==1)
{
printf("%lld",g[i]);
}

}

}
}

printf("\n");
t++;
}

return 0;
}
munnapagol
New poster

Posts: 2
Joined: Fri Oct 12, 2012 2:28 am

### Re: 10101 - Bangla Numbers

The case number should be right aligned in a field of width four. Next time post with the code blocks so the indentation is preserved.
brianfry713
Guru

Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Previous