Advertisement
elena1234

HTML

Nov 17th, 2020 (edited)
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace HTML
  5. {
  6.     class MainClass
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.             StringBuilder sb = new StringBuilder();
  11.             string title = Console.ReadLine();
  12.             sb.AppendLine("<h1>");
  13.             sb.AppendLine(title);
  14.             sb.AppendLine("</h1>");
  15.  
  16.             string content = Console.ReadLine();
  17.             sb.AppendLine("<article>");
  18.             sb.AppendLine(content);
  19.             sb.AppendLine("</article>");
  20.  
  21.             string comment = string.Empty;
  22.             while((comment=Console.ReadLine())!="end of comments")
  23.             {
  24.                 sb.AppendLine("<div>");
  25.                 sb.AppendLine(comment);
  26.                 sb.AppendLine("</div>");
  27.             }
  28.  
  29.             Console.WriteLine(sb);
  30.         }
  31.       }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement