#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;
}
The solution below may be very easy to understand and implement 🙂
str1 = str(input(“Enter 1st word: “))
str2 = str(input(“Enter 2nd word: “))
str3 = str(input(“Enter 3rd word: “))
vow = [‘a’, ‘e’, ‘i’, ‘o’, ‘u’]
for i in str1.lower():
if i in vow:
str1 = str1.replace(i,”*”)
for i in str2.lower():
if i not in vow:
str2 = str2.replace(i,”@”)
print(str1+str2+str3.upper())
python code:
vowels={“a”,”e”,”i”,”o”,”u”}
consonants={“b”,”c”,”d”,”f”,”g”,”h”,”j”,”k”,”l”,”m”,”n”,”p”,”q”,”r”,”s”,”t”,”v”,”w”,”x”,”y”,”z”}
n1=str(input())
n2=str(input())
n3=str(input())
n4,n5,n6=””,””,””
for i in n1:
if i in vowels:
i=”*”
n4=n4+i
else:
n4=n4+i
for i in n2:
if i in consonants:
i=”@”
n5=n5+i
else:
n5=n5+i
n6=n3.upper()
print(n4+n5+n6)
Incase anyone looking for python code
Here it is
w1 = input()
w2 = input()
w3 = input()
for i in w1:
if(i==”a” or i==”e” or i==”i” or i==”o” or i==”u” or i==”A” or i==”E” or i==”I” or i==”O” or i==”U”):
w1 = w1.replace(i,”*”)
for i in w2:
if(i==”a” or i==”e” or i==”i” or i==”o” or i==”u” or i==”A” or i==”E” or i==”I” or i==”O” or i==”U”):
w2 = w2.replace(i,i)
else:
w2 = w2.replace(i,”@”)
w3 = w3.upper()
print(w1,w2,w3)
print(“thank me later ;)”)
string=input(“enter the string”)
str1, str2, str3-string.split(” “)
list1=[‘a’, ‘e’,’1′,’o’, ‘u’]
for i in strl:
if i in list1:
str1=str1.replace(i,’*’)
For j in str2:
if j not in list:
str2=str2. replace (j,’@’)
For k in str3:
str3=str3.upper ()
print (strl+atr2+atr3)
a=input()
b=input()
c=input()
vow=”aeiou”
s=””
s1=””
s2=””
for i in a:
if i in vow:
s+=”*”
else:
s+=i
for i in b:
if i not in vow:
s1+=”@”
else:
s1+=i
s2=c.upper()
print(s+s1+s2)
java code
import java.util.Scanner;
import java.lang.*;
class Name
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
String words[]=new String[3];
System.out.print(“Enter the 3 words :”);
for(int j=0;j<words.length;j++)
{
words[j]=sc.next();
{
if(j==0)
{
char a[]=words[j].toCharArray() ;
for(int i=0;i<a.length;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(int i=0;i<a.length;i++)
{
System.out.print(a[i]);
}
System.out.print(" ");
}
if(j==1)
{
char a[]=words[j].toCharArray();
for(int i=0;i<a.length;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(int i=0;i<a.length;i++)
{
System.out.print(a[i]);
}
System.out.print(" ");
}
if(j==2)
{
char a[]=words[j].toCharArray();
for(int i=0;i<a.length;i++)
{
if(Character.isLetter(a[i])&&Character.isLowerCase(a[i]))
a[i]=Character.toUpperCase(a[i]);
}
for(int i=0;i<a.length;i++)
{
System.out.print(a[i]);
}
}
}
}
}
}
Program in python:
vowel={‘a’,’e’,’i’,’o’,’u’}
a=str(input())
b=str(input())
c=str(input())
for x in a:
if x in vowel:
a=a.replace(x,’*’)
for y in b:
if y not in vowel:
b=b.replace(y,’@’)
c=c.upper()
print(a+b+c)
thanks for makes code very easy. but, there is one mistake I solved it.
how
999
you
Expected Output : h*w999YOU
the code is correct now.
vowel={‘a’,’e’,’i’,’o’,’u’}
numbers={0,1,2,3,4,5,6,7,8,9}
a=str(input())
b=str(input())
c=str(input())
for x in a:
if x in vowel:
a=a.replace(x,’*’)
for y in b:
if y in vowel or numbers:
pass
else:
b=b.replace(y,’@’)
c=c.upper()
print(a+b+c)
word1 = input()
word2 = input()
word3 = input()
l1 = list(word1)
l2 = list(word2)
vowels = [‘a’, ‘e’, ‘i’, ‘o’, ‘u’, ‘A’, ‘E’, ‘I’, ‘O’, ‘U’]
for i in range(0, len(l1)):
if l1[i] in vowels:
l1[i] = ‘*’
for j in range(len(word2)):
if l2[j] in vowels:
continue
else:
l2[j] = ‘@’
print(”.join(l1) + ”.join(l2) + word3.upper())
sir i have question when we have to solve test case two how will the program we wrote will be justified can you kindly explain ?//if possible do help by droping the code in python for the second test case there was no solution in python available//
Please reach out as soon as possible
a=str(input())
b=str(input())
c=str(input())
v=[‘a’,’e’,’i’,’o’,’u’]
for i in a:
if i in v :
r=a.replace(i,’*’)
for i in b:
if i not in b :
s=b.replace(i,’@’)
last=c.upper()
final=r + s + last
print(final)
this is for java
import java.util.Scanner;
public class changingwords {
public static void main(String s[]){
String s1,s2,s3;
Scanner sin=new Scanner(System.in);
s1=sin.nextLine();
s2=sin.nextLine();
s3=sin.nextLine();
System.out.println(s1.replaceAll(“[AaEeIiOoUu]”, “*”)+s2.replaceAll(“[^AaEeIiOoUu]”, “@”)+s3.toUpperCase());
}
}
a=input()
b=input()
c=input()
for i in a:
if(i==”a” or i==”e” or i==”i” or i==”o” or i==”u” or i==”A” or i==”E” or i==”I” or i==”O” or i==”U”):
print(“*”,end=””)
else:
print(i,end=””)
for i in b:
if not (i==”a” or i==”e” or i==”i” or i==”o” or i==”u” or i==”A” or i==”E” or i==”I” or i==”O” or i==”U”):
print(“@”,end=””)
else:
print(i,end=””)
print(c.upper(),end=””)
str1 = input(“Enter 1st word: “)
str2 = input(“Enter 2st word: “)
str3 = input(“Enter 3st word: “)
vowel = ‘aeiouAEIOU’
conso = ‘bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ’
for i in str1:
if i in vowel:
str1 = str1.replace(i,’@’)
for j in str2:
if j in conso:
str2 = str2.replace(j,’#’)
str3 = str3.upper()
print(str1+str2+str3)
l=[‘a’,’e’,’i’,’o’,’u’]
o=[‘b’,’c’,’d’,’f’,’g’,’h’,’j’,’k’,’l’,’m’,’n’,’p’,’q’,’r’,’s’,’t’,’v’,’w’,’x’,’y’,’z’]
k=[]
inp=list(map(str,input().split()))
for i in inp[0]:
if i in l:
print(“i:”,i)
i=’*’
k.append(i)
else:
k.append(i)
for j in inp[1]:
if j in o:
print(“j:”,j)
j=’@’
k.append(j)
else:
k.append(j)
h=inp[2]
f=h.upper()
k.append(f)
sep=”
print(sep.join(k))