SHARE
TWEET

problem D

rafi1590 Feb 25th, 2020 (edited) 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<string.h>
  3.   char word[150];
  4.     char nword[150];
  5.     char nword1[150];
  6. int main(){
  7. for(int i=0;i<150;i++){
  8.     word[i] = '\0';
  9.     nword[i] = '\0';
  10.     nword1[i] = '\0';
  11. }
  12.     scanf("%s",word);
  13.     int j=0;
  14.     int len = strlen(word);
  15.     for(int i=0;i<len;i++){
  16.         if(word[i]!='a' && word[i]!='A' && word[i]!='e' && word[i]!='E' && word[i]!='i' && word[i]!='I' && word[i]!='o' && word[i]!='O' &&  word[i]!='u' && word[i]!='U' && word[i]!='Y' && word[i]!='y'){
  17.             nword[j] = word[i];
  18.             j++;
  19.  
  20.         }
  21.     }
  22.  
  23. int len1 = strlen(nword);
  24. int len2 = 2 * len1;
  25.  
  26. int p =0;
  27. for(int i=0;i<len2;i++){
  28.         if(i%2==0){
  29.             nword1[i] = '.';
  30.  
  31.         }
  32.         else {
  33.             nword1[i] = nword[p];
  34.             p++;
  35.         }
  36.     }
  37. char let1 = 'a';
  38. char let = 'A';
  39. char u_case[26];
  40. char l_case[26];
  41. for(int i=0;i<26;i++) {
  42.         u_case[i] = let;
  43.         l_case[i] = let1;
  44.         let++;
  45.         let1++;
  46.     }
  47.  int ln= strlen(nword1);
  48.     for(int i=0;i<ln;i++){
  49.         for(int j=0;j<26;j++){
  50.             if(nword1[i]==u_case[j]){
  51.                 nword1[i] = l_case[j];
  52.             }
  53.         }
  54.  
  55.  
  56.         }
  57.  
  58.   printf("%s\n",nword1) ;
  59.  
  60.     return 0;
  61. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top