-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDay32_prob2.java
59 lines (43 loc) · 1.24 KB
/
Day32_prob2.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
Ask rahul to give two of his friends name.and help rahul to count the number of vowels present in these two names. if no vowels present thent print "0".
Example
Input
ramesh
tushar
Output
4
Input Format
first line accept first Name
second line accept 2nd Name
Constraints
name must contain alhabates only.
Output Format
First line must be no of Vowels presnt in both the names.
Sample Input 0
ramesh
suresh
Sample Output 0
4
*/
// kirtan jain
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
String s1 = sc.nextLine(), s2 = sc.nextLine();
int result = 0;
for(int i=0;i<s1.length();i++){
if(s1.charAt(i)=='a' || s1.charAt(i)=='e' || s1.charAt(i)=='i' || s1.charAt(i)=='o' || s1.charAt(i)=='u'){
result++;
}
}
for(int i=0;i<s2.length();i++){
if(s2.charAt(i)=='a' || s2.charAt(i)=='e' || s2.charAt(i)=='i' || s2.charAt(i)=='o' || s2.charAt(i)=='u'){
result++;
}
}
System.out.print(result);
}
}