#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
int i;
char a[100],b[100],c[100];
scanf("%s",a);
scanf("%s",b);
scanf("%s",c);
for(i=0;a[i]!='\0';i++)
{
if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u'||a[i]=='A'||a[i]=='E'||a[i]=='I'||a[i]=='O'||a[i]=='U')
a[i]='*';
}
for(i=0;b[i]!='\0';i++)
{
if((b[i]>='a'&&b[i]<='z') || (b[i]>='A'&&b[i]<='Z'))
if(!(b[i]=='a'||b[i]=='e'||b[i]=='i'||b[i]=='o'||b[i]=='u'||b[i]=='A'||b[i]=='E'||b[i]=='I'||b[i]=='O'||b[i]=='U'))
b[i]='@';
}
for(i=0;c[i]!='\0';i++)
{
if(c[i]>='a'&&c[i]<='z')
c[i]=c[i]-32;
}
printf("%s%s%s",a,b,c);
return 0;
}
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
int i;
char a[100],b[100],c[100];
cin >> a;
cin >> b;
cin >> c;
for(i=0;a[i]!='\0';i++)
{
if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u'||a[i]=='A'||a[i]=='E'||a[i]=='I'||a[i]=='O'||a[i]=='U')
a[i]='*';
}
for(i=0;b[i]!='\0';i++)
{
if((b[i]>='a'&&b[i]<='z') || (b[i]>='A'&&b[i]<='Z'))
if(!(b[i]=='a'||b[i]=='e'||b[i]=='i'||b[i]=='o'||b[i]=='u'||b[i]=='A'||b[i]=='E'||b[i]=='I'||b[i]=='O'||b[i]=='U'))
b[i]='@';
}
for(i=0;c[i]!='\0';i++)
{
if(c[i]>='a'&&c[i]<='z')
c[i]=c[i]-32;
}
cout << a << b<< c;
return 0;
}
x=input()
y=input()
l=[“e”,”a”,”i”,”o”,”u”]
for i in x:
if i in l:
x=x.replace(i,”*”)
for i in y:
if i not in l:
y = y.replace(i, “*”)
print(x,y)
a=[]
p=[‘a’,’e’,’i’,’o’,’u’,’A’,’E’,’I’,’O’,’U’]
for i in range(3):
a.append(input())
for i in a[0]:
if (i==’A’ or i==’a’ or i==’E’ or i ==’e’ or i==’I’ or i==’i’ or i==’O’ or i==’o’ or i==’U’ or i==’u’):
a[0]=a[0].replace(i,’*’)
for i in a[1]:
if (i==’A’ or i==’a’ or i==’E’ or i ==’e’ or i==’I’ or i==’i’ or i==’O’ or i==’o’ or i==’U’ or i==’u’):
continue
else:
a[1]=a[1].replace(i,’@’)
a[2]=a[2].upper()
print(a[0]+a[1]+a[2])
a=input().lower()
b=input().lower()
c=input().lower()
x=list(a)
y=list(b)
vowels=(‘a’,’e’,’i’,’o’,’u’)
for i in range(len(x)):
if x[i] in vowels:
x[i]=’*’
a=”.join(x)
for i in range(len(y)):
if not y[i] in vowels:
y[i]=’@’
b=”.join(y)
c=c.upper()
result=a+b+c
print(result)
Mekala Sekhar python code:
import time
start=time.time()
l=[]
for i in range(3):
l.append(input())
k=l[0]
k1=l[1]
k2=l[2]
l1=[“a”,’e’,’i’,’o’,’u’]
for char in l1:
if char in k:
m=k.replace(char,”*”)
k=m
else:
pass
for i in range(len(k1)):
if k1[i] in l1:
pass
else:
p=k1.replace(k1[i],”@”)
k1=p
print(k+k1+k2.upper())
end=time.time()
total=end-start
print(total)
Prashant java code using Strings:
import java.util.*;
public class words1 {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
String a=sc.nextLine();
String b=sc.nextLine();
String c=sc.nextLine();
String d=” “;String e=” “,;
d=a;e=b;
//first string
int la=a.length();
for(int i=0;i<la;i++)
{char ch=a.charAt(i);
if(ch=='a'||ch=='A'||ch=='o'||ch=='O'||ch=='i'||ch=='I'||ch=='e'||ch=='E'||ch=='u'||ch=='U') {
d= d.replace(d.charAt(i),'*');
}
}//Second string
int lb=b.length();
for(int j=0;j<lb;j++)
{char cha=b.charAt(j);
if(!(cha=='a'||cha=='A'||cha=='o'||cha=='O'||cha=='i'||cha=='I'||cha=='e'||cha=='E'||cha=='u'||cha=='U')) {
e= e.replace(e.charAt(j),'@');
}
}//third string
c=c.toUpperCase();
//Printing
System.out.println(d+e+c);
}
}
divya #pythoncode
first_word = input(“Enter your first text:”)
result = “”
for c in range(len(first_word)):
char = first_word[c]
if char ==’a’or char ==’e’or char ==’i’ or char ==’o’ or char ==’u’:
result = result + ‘%’
else:
result = result + char
second_word =input(“Enter your second text:”)
for c in range (len(second_word)):
char = second_word[c]
if char ==’b’ or char ==’c’ or char ==’d’ or char ==’f’ or char ==’g’ or char ==’h’ or char ==’j’ or char ==’k’ or char ==’l’ or char ==’m’ or char ==’n’ or char ==’o’ or char ==’p’ or char ==’q’ or char ==’r’ or char ==’s’ or char ==’t’ or char ==’v’ or char ==’w’ or char ==’x’ or char ==’y’ or char ==’z’:
result = result + ‘#’
else:
result = result + char
third_word =input(“Enter your third text:”)
result =result+ third_word.upper()
print(result)
python solution:
s1=input()
s2=input()
s3=input()
l=””
for i in s1:
if i in (‘a’,’e’,’i’,’o’,’u’):
l=l+’*’
else:
l=l+i
for i in s2:
if i not in (‘a’,’e’,’i’,’o’,’u’):
l=l+’@’
else:
l=l+i
l=l+s3.upper()
print(l)
python code:
n1=input()
finalstr=””
vowels=”aeiou”
for i in n1:
if i in vowels:
finalstr+=”*”
else:
finalstr+=i
n2=input()
for i in n2:
if i not in vowels:
finalstr+=”@”
else:
finalstr+=i
n3=input()
finalstr+=n3.upper()
print(finalstr)
Code in python passing both the test cases:
s1=input()
s2=input()
s3=input()
vowels=’AaEeIiOoUu’
res=”
digits=’1,2,3,4,5,6,7,8,9′
for i in range(len(s1)):
if(s[i] in vowels):
s1=s1.replace(s1[i],’%’)
for i in range(len(s2)):
if(s2[i] in vowels) or (s2[i] in digits):
continue
else:
s2=s2.replace(s2[i],’#’)
s3=s3.upper()
res=s1+s2+s3
print(res)
Sorry for that in the last comment i forgot to validate whether they are number in case on consonents. cant find any option to edit or delete comment in this thread
def takeword(word, choice):
vowel = [‘a’, ‘e’, ‘i’, ‘o’, ‘u’]
nums = [‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’]
if choice == 1:
for let in word:
if let in vowel:
word = word.replace(let, “*”)
return word
elif choice == 2:
for let in word:
if let not in vowel and word.isalpha():
word = word.replace(let, “@”)
return word
elif choice == 3:
word = word.upper()
return word
x = input(“enter first string”)
y = input(“enter the third string”)
z = input(“enter the second number”)
print(takeword(x, 1)+takeword(y, 2)+takeword(z, 3))
Python code
def takeword(word, choice):
vowel = [‘a’, ‘e’, ‘i’, ‘o’, ‘u’]
conso = []
if choice == 1:
for let in word:
if let in vowel:
word = word.replace(let, “*”)
return word
elif choice == 2:
for let in word:
if let not in vowel:
word = word.replace(let, “@”)
return word
elif choice == 3:
word = word.upper()
return word
x = input(“enter first string”)
y = input(“enter the third string”)
z = input(“enter the second number”)
print(takeword(x, 1)+takeword(y, 2)+takeword(z, 3))
p = str(input())
q = str(input())
r = str(input())
A = [“A”,”E”,”I”,”O”,”U”,”a”,”e”,”i”,”o”,”u”]
for i in p:
if i in A:
p = p.replace(i,”*”)
for j in q:
if j not in A:
q = q.replace(j,”@”)
r = r.upper()
print(p+q+r)