RGAlex

O5. HTML / Text Processing - More Exercise

Mar 15th, 2021
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. package TextPlocessing.MoreExercises;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class O5HTML {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         String first = scanner.nextLine();
  9.         String second = scanner.nextLine();
  10.         String input = scanner.nextLine();
  11.  
  12.         System.out.printf("<h1>%n    %s%n</h1>%n<article>%n    %s%n</article>%n", first, second);
  13.  
  14.         while (!"end of comments".equals(input)) {
  15.             System.out.printf("<div>%n    %s%n</div>%n", input);
  16.             input = scanner.nextLine();
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment