-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreversing.java
More file actions
48 lines (48 loc) · 999 Bytes
/
Copy pathreversing.java
File metadata and controls
48 lines (48 loc) · 999 Bytes
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
import java.util.*;
class reversing
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
vowel v=new vowel();
String str=sc.nextLine();
System.out.println(v.vowelrem(str));
}
}
class vowel
{
public String vowelrem(String a)
{
StringBuffer str=new StringBuffer(a);
System.out.println(str.reverse());
int i,asci;
for(i=0;i<str.length();i++)
{
asci=str.charAt(i);
if(asci>=97 &&asci<=122)
asci=asci-96;
else if(asci>=65 && asci<=90)
asci=asci-64;
switch(asci)
{
case 1:str.delete(i,i+1);
i--;
break;
case 5:str.delete(i,i+1);
i--;
break;
case 9:str.delete(i,i+1);
i--;
break;
case 15:str.delete(i,i+1);
i--;
break;
case 21:str.delete(i,i+1);
i--;
break;
}
}
a=str.toString();
return a;
}
}