TheBulgarianWolf

HTML

Mar 28th, 2021
565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace Html
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             StringBuilder sb = new StringBuilder();
  11.             Console.WriteLine("Enter a title of an article: ");
  12.             string title = Console.ReadLine();
  13.             string h1 = "<h1>\n\t" + title + "\n</h1>\n";
  14.             sb.Append(h1);
  15.             Console.WriteLine("Enter the content of that article: ");
  16.             string content = Console.ReadLine();
  17.             string article = "<article>\n\t" + content + "\n</article>\n";
  18.             sb.Append(article);
  19.             string comment;
  20.             while((comment = Console.ReadLine()) != "end of comments")
  21.             {
  22.                 string div = "<div>\n\t" + comment + "\n</div>\n";
  23.                 sb.Append(div);
  24.             }
  25.             sb.ToString();
  26.             Console.WriteLine(sb);
  27.         }
  28.     }
  29. }
  30.  
Add Comment
Please, Sign In to add comment