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 |
import java.util.Scanner; /** * UVA272 */ public class UVA272 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); boolean symbol = false; while (sc.hasNextLine()) { String temp = sc.nextLine(); for (int i = 0; i < temp.length(); i++) { if (temp.charAt(i) == '\"') { if (!symbol) System.out.print("<code></code>"); else System.out.print("\'\'"); symbol = !symbol; } else System.out.print(temp.charAt(i)); } System.out.println(); } sc.close(); } } |