Advertisement
EvlogiHr

SevenlandNumbers

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