///...................SUBHASHIS MOLLICK....................///
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///.....................SESSION-(14-15)....................///
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<ctype.h>
#include<bits/stdc++.h>
using namespace std;
main()
{
char s[10010]={0};
while(gets(s))
{
long i,j,l,ar[100000]={0},k2,sum=0;
l=strlen(s);
for(i=l-1;i>=0;i--)
{
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')||(s[i]==32)||(s[i]==33)||(s[i]==44)||(s[i]==46)||(s[i]==58)||(s[i]==59)||(s[i]==63))
{
long a=s[i]-0,k1=0,k;
while(a!=0)
{
k=a%10;
ar[k1]=k;
k1++;
a=a/10;
}
for(j=0;j<k1;j++)
{
printf("%ld",ar[j]);
}
}
else
{
if(s[i]=='1')
{
for(k2=i;k2>=i-2;k2--)
{
sum=sum*10+(s[k2]-48);
}
i=i-2;
printf("%c",sum);
sum=0;
}
else
{
for(k2=i;k2>=i-1;k2--)
{
sum=sum*10+(s[k2]-48);
}
i=i-1;
printf("%c",sum);
sum=0;
}
}
}
printf("\n");
}
}
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///.....................SESSION-(14-15)....................///
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<ctype.h>
#include<bits/stdc++.h>
using namespace std;
main()
{
char s[10010]={0};
while(gets(s))
{
long i,j,l,ar[100000]={0},k2,sum=0;
l=strlen(s);
for(i=l-1;i>=0;i--)
{
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')||(s[i]==32)||(s[i]==33)||(s[i]==44)||(s[i]==46)||(s[i]==58)||(s[i]==59)||(s[i]==63))
{
long a=s[i]-0,k1=0,k;
while(a!=0)
{
k=a%10;
ar[k1]=k;
k1++;
a=a/10;
}
for(j=0;j<k1;j++)
{
printf("%ld",ar[j]);
}
}
else
{
if(s[i]=='1')
{
for(k2=i;k2>=i-2;k2--)
{
sum=sum*10+(s[k2]-48);
}
i=i-2;
printf("%c",sum);
sum=0;
}
else
{
for(k2=i;k2>=i-1;k2--)
{
sum=sum*10+(s[k2]-48);
}
i=i-1;
printf("%c",sum);
sum=0;
}
}
}
printf("\n");
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন