Advertisement
nahidjamalli

Lesson #13

Apr 14th, 2020
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2.  
  3. class PipeServer
  4. {
  5.     static void Main()
  6.     {
  7.         int num = int.Parse(Console.ReadLine());
  8.  
  9.         if (num / 1000 == 6)
  10.         {
  11.             Console.WriteLine(num + 3000);
  12.         }
  13.         else if ((num / 100) % 10 == 6)
  14.         {
  15.             Console.WriteLine(num + 300);
  16.         }
  17.         else if ((num / 10) % 10 == 6)
  18.         {
  19.             Console.WriteLine(num + 30);
  20.         }
  21.         else if (num % 10 == 6)
  22.         {
  23.             Console.WriteLine(num + 3);
  24.         }
  25.         else Console.WriteLine(num);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement