import java.util.Scanner; public class Labtest1demo { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner reader = new Scanner(System.in); String input = reader.nextLine(); for (int i=0; i<input.length(); ++i) { if (i==0) { if (input.charAt(i)=='A' && input.charAt(i+1)==' ') System.out.print("ONE"); else System.out.print(input.charAt(i)); } else if (i==input.length()-1 && input.charAt(i)=='a' && input.charAt(i-1)==' ') { System.out.print("one"); } else if (input.charAt(i)=='a' && input.charAt(i-1)==' ' && input.charAt(i+1)==' ') { System.out.print("one"); } else System.out.print(input.charAt(i)); } } }
Wednesday, September 30, 2009
lab test 1 demo for sec 6
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment