রবিবার, ২৮ আগস্ট, ২০১৬

UVA 492 - Pig-Latin

///...................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()
main()
{
char s[1000000]={0}, a[10000]={0};
while(gets(s))
{
long i,j,k1=0,k;
   long l=strlen(s);
   for(k=0;k<l;k++)
   {

    if(s[k]=='e' || s[k]=='o' || s[k]=='i' || s[k]=='u' || s[k]=='A' || s[k]=='E' || s[k]=='I' || s[k]=='O' || s[k]=='U' ||s[k]=='a')
{
for(i=k;i<=l;i++)
       {
       if(s[i]=='e' || s[i]=='o' || s[i]=='i' || s[i]=='u' || s[i]=='A' || s[i]=='E' || s[i]=='I' || s[i]=='O' || s[i]=='U' ||s[i]=='a'|| s[i]=='b' || s[i]=='c'  || s[i]=='d' || s[i]=='f' || s[i]=='g' || s[i]=='h' || s[i]=='j' || s[i]=='k' ||s[i]=='l' || s[i]=='m' ||s[i]=='n'|| s[i]=='p' || s[i]=='q' || s[i]=='r' || s[i]=='s' || s[i]=='t' || s[i]=='v' || s[i]=='w' || s[i]=='x' ||s[i]=='z'|| s[i]=='B' || s[i]=='C' || s[i]=='D' || s[i]=='F' || s[i]=='G' || s[i]=='H' || s[i]=='J' || s[i]=='K' || s[i]=='L' ||s[i]=='M' || s[i]=='N'  || s[i]=='P' || s[i]=='Q' || s[i]=='R' || s[i]=='S' || s[i]=='T' || s[i]=='V'|| s[i]=='W' || s[i]=='X' ||s[i]=='Z' || s[i]=='y' || s[i]=='Y')
               printf("%c",s[i]);
           else
   {
    printf("ay");
    k=i-1;
    break;
}
   }
}
else if(s[k]=='e' || s[k]=='o' || s[k]=='i' || s[k]=='u' || s[k]=='A' || s[k]=='E' || s[k]=='I' || s[k]=='O' || s[k]=='U' ||s[k]=='a'|| s[k]=='b' || s[k]=='c'  || s[k]=='d' || s[k]=='f' || s[k]=='g' || s[k]=='h' || s[k]=='j' || s[k]=='k' ||s[k]=='l' || s[k]=='m' ||s[k]=='n'|| s[k]=='p' || s[k]=='q' || s[k]=='r' || s[k]=='s' || s[k]=='t' || s[k]=='v' || s[k]=='w' || s[k]=='x' ||s[k]=='z'|| s[k]=='B' || s[k]=='C' || s[k]=='D' || s[k]=='F' || s[k]=='G' || s[k]=='H' || s[k]=='J' || s[k]=='K' || s[k]=='L' ||s[k]=='M' || s[k]=='N'  || s[k]=='P' || s[k]=='Q' || s[k]=='R' || s[k]=='S' || s[k]=='T' || s[k]=='V'|| s[k]=='W' || s[k]=='X' ||s[k]=='Z' || s[k]=='y' || s[k]=='Y')
{
for(i=k+1;i<=l;i++)
       {

       if(s[i]=='e' || s[i]=='o' || s[i]=='i' || s[i]=='u' || s[i]=='A' || s[i]=='E' || s[i]=='I' || s[i]=='O' || s[i]=='U' ||s[i]=='a'|| s[i]=='b' || s[i]=='c'  || s[i]=='d' || s[i]=='f' || s[i]=='g' || s[i]=='h' || s[i]=='j' || s[i]=='k' ||s[i]=='l' || s[i]=='m' ||s[i]=='n'|| s[i]=='p' || s[i]=='q' || s[i]=='r' || s[i]=='s' || s[i]=='t' || s[i]=='v' || s[i]=='w' || s[i]=='x' ||s[i]=='z'|| s[i]=='B' || s[i]=='C' || s[i]=='D' || s[i]=='F' || s[i]=='G' || s[i]=='H' || s[i]=='J' || s[i]=='K' || s[i]=='L' ||s[i]=='M' || s[i]=='N'  || s[i]=='P' || s[i]=='Q' || s[i]=='R' || s[i]=='S' || s[i]=='T' || s[i]=='V'|| s[i]=='W' || s[i]=='X' ||s[i]=='Z' || s[i]=='y' || s[i]=='Y')
               printf("%c",s[i]);
           else
   {
    printf("%c",s[k]);
    printf("ay");
    k=i-1;
    break;
}
   }
}
else
            printf("%c",s[k]);
}
printf("\n");
}

}

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন

Factory Pattern

Factory Method  is a creational design pattern that provides an interface for creating objects in a superclass but allows subclasses to alte...