Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Adhoc2 {
- public static void main(String[] args) {
- String str = "Ev4o t3i b2aki 3pa 4se ig3raa2j mal4o";
- String novi = "";
- for (int i = 0; i < str.length() ; i++) {
- if(str.charAt(i) != '2' && str.charAt(i) != '3' && str.charAt(i) != '4'){
- System.out.print(novi + str.charAt(i));
- }
- if(str.charAt(i) == '2' ){
- System.out.print(novi + str.charAt(i + 1));
- }
- if(str.charAt(i) == '3'){
- System.out.print(novi + str.charAt(i + 1));
- System.out.print(str.charAt(i + 1));
- }
- if(str.charAt(i) == '4'){
- System.out.print(novi + str.charAt(i + 1));
- System.out.print(novi + str.charAt(i + 1));
- System.out.print(novi + str.charAt(i + 1));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement