#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;
}
Using Java Code
import java.util.*;
class HelloWorld {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println(“First input”);
String s1=sc.next();
System.out.println(“Second input”);
String s2=sc.next();
System.out.println(“Third input”);
String s3=sc.next();
String s11=””;
String s22=””;
String s33=””;
for(int i=0,j=0,k=0;i<s1.length() && j<s2.length() && k=97 && s3.charAt(k)<=122){
s33+=Character.toUpperCase(s3.charAt(k));
k++;
}
else{
k++;
}
}
System.out.println(s11+s22+s33);
}
}
Whole program was unable to post.
It was posting only half of the program.
Instead of creating 3for loops just do it in single loop.
Time complexity : O(n)
Hey there
Thanks for commenting, Kindly refer Discord this link for doubts.
Kindly refer Discord this link.
Using Java Code
import java. util.*;
class fing {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println(“First input”);
String s1=sc.next();
System.out.println(“Second input”);
String s2=sc.next();
System.out.println(“Third input”);
String s3=sc.next();
String s11=””;
String s22=””;
String s33=””;
for(int i=0,j=0,k=0;i<s1.length() && j<s2.length() && k=97 && s3.charAt(k)<=122){
s33+=Character.toUpperCase(s3.charAt(k));
k++;
}
else{
k++;
}
}
System.out.println(s11+s22+s33);
}
}
Kindly refer Discord this link.
#using PYTHON code
—————————
str1=input()
str2=input()
str3=input()
l=[‘a’,’e’,’i’,’o’,’u’]
l1=[]
for ch in l:
for ch1 in str1:
if(ch==ch1):
str1=str1.replace(ch1,”*”)
for ch2 in str2:
if ch2 not in l:
l1.append(ch2)
for ch3 in l1:
for ch2 in str2:
if(ch3==ch2):
str2=str2.replace(ch2,”@”)
str3=str3.upper()
print(str1+str2+str3)
#using PYTHON code
str1=input()
str2=input()
str3=input()
l=[‘a’,’e’,’i’,’o’,’u’]
l1=[]
for ch in l:
for ch1 in str1:
if(ch==ch1):
str1=str1.replace(ch1,”*”)
for ch2 in str2:
if ch2 not in l:
l1.append(ch2)
for ch3 in l1:
for ch2 in str2:
if(ch3==ch2):
str2=str2.replace(ch2,”@”)
str3=str3.upper()
print(str1+str2+str3)
#include
int main()
{
char s[10000];
int i,l=1;
scanf(“%[^\n]”,s);
for(i=0;s[i]!=0;i++)
{
if(s[i]==’ ‘)
{
// printf(“\n”);
l++;
continue;
}
else if(l==1)
{
if(s[i]==’a’||s[i]==’A’||s[i]==’e’||s[i]==’E’||s[i]==’i’||s[i]==’I’||s[i]==’o’||s[i]==’O’||s[i]==’u’||s[i]==’U’)
printf(“*”);
else
printf(“%c”,s[i]);
}
else if(l==2)
{
if(s[i]==’a’||s[i]==’A’||s[i]==’e’||s[i]==’E’||s[i]==’i’||s[i]==’I’||s[i]==’o’||s[i]==’O’||s[i]==’u’||s[i]==’U’)
printf(“%c”,s[i]);
else if(s[i]>=’0’&&s[i]=’a’&&s[i]<='z')
printf("%c",s[i]-32);
}
}
return 0;
}
Using Python:
——————————–
v=[“a”,”e”,”i”,”o”,”u”]
lst=[]
s1,s2,s3=””,””,””
for i in range(3):
n=input()
lst.append(n)
for i in lst[0]:
if i in v:
s1+=”*”
else:
s1+=i
for i in lst[1]:
if i in v:
s2+=i
else:
s2+=”@”
for i in lst[2]:
s3+=i.upper()
print(s1+s2+s3)
——————————–
x=list(input())
y=list(input())
z=input()
c=[‘a’,’e’,’i’,’o’,’u’]
for i in range(len(x)):
if x[i] in c:
x[i]=”%”
for i in range(len(y)):
if y[i] not in c:
y[i]=”#”
print(“”.join(x)+””.join(y)+z.upper())
a=[str(d) for d in str(input(“enter a word:”))]
b=[str(d) for d in str(input(“enter a word:”))]
c=[input(“enter a word:”).upper()]
for i in range(0,len(a)):
if (a[i]==”a” or a[i]==”e” or a[i]==”i” or a[i]==’o’ or a[i]==’u’):
a[i]=”*”
for i in range(0,len(b)):
if((b[ i ]>=’a’ and b[i]=’A’ and b[i]<='Z')):
if (not(b[i]=="a" or b[i]=="e" or b[i]=="i" or b[i]=='o' or b[i]=='u')):
b[i]="@"
print(a + b + c )
x=[]
for i in range(3):
x.append(input())
str1=”
str2=”
str3=”
for i in range(3):
if i==0:
for j in range(len(x[0])):
if x[0][j] in “aeiouAEIOU”:
str1=str1+’%’
else:
str1=str1+x[0][j]
if i==1:
for j in range(len(x[1])):
if x[1][j] not in “aeiouAEIOU” and x[1][j].isalpha():
str2=str2+’#’
else:
str2=str2+x[1][j]
if i==2:
for j in range(len(x[2])):
if x[2][j].isalpha() and x[2][j].islower():
str3=str3+x[2][j].upper()
else:
str3=str3+x[2][j]
print(str1,str2.strip(),str3,sep=”)
x=[]
for i in range(3):
x.append(input())
str1=”
str2=”
str3=”
for i in range(3):
if i==0:
for j in range(len(x[0])):
if x[0][j] in “aeiouAEIOU”:
str1=str1+’%’
else:
str1=str1+x[0][j]
if i==1:
for j in range(len(x[1])):
if x[1][j] not in “aeiouAEIOU” and x[1][j].isalpha():
str2=str2+’#’
else:
str2=str2+x[1][j]
if i==2:
for j in range(len(x[2])):
if x[2][j].isalpha() and x[2][j].islower():
str3=str3+x[2][j].upper()
else:
str3=str3+x[2][j]
print(str1,str2.strip(),str3,sep=”)
Using Java CODE :-
===========
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println(“Enter First String”);
String str1=s.nextLine();
System.out.println(“Enter Second String”);
String str2=s.nextLine();
System.out.println(“Enter third String”);
String str3=s.nextLine();
str3=str3.toUpperCase();
String res=””;
for(int i=0;i<str1.length();i++)
{
char ch=str1.charAt(i);
if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
{
str1=str1.replace(ch,'*');
}//end of if
}//end of for loop
for(int i=0;i<str2.length();i++)
{
char ch=str2.charAt(i);
if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
{
continue;
}//end of if
else if(ch=='0'||ch=='1'||ch=='2'||ch=='3'||ch=='4'||ch=='5'||ch=='6'||ch=='7'||ch=='8'||ch=='9')
{
continue;
}
else{
str2=str2.replace(ch,'@');
}
}//end of for loop
res=res.concat(str1).concat(str2).concat(str3);
System.out.println(res);
}
}
a=input()
b=input()
c=input()
for i in a:
if i in “aeiou”:
print(a.replace(i,”*”))
for i in b:
if i not in “aeiou”:
print(b.replace(i,”@”))
d=c.upper()
print(d)