Advertisement
csaki

lnko

Oct 17th, 2012
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace számbekérés
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Console.WriteLine("LNKO!");
  13.             Console.Write("Első szám: ");
  14.             int elso = int.Parse(Console.ReadLine());
  15.             Console.Write("Második szám: ");
  16.             int masodik = int.Parse(Console.ReadLine());
  17.  
  18.             while (elso != masodik)
  19.             {
  20.                 if (elso > masodik)
  21.                 {
  22.                     elso -= masodik;
  23.                 }
  24.                 else
  25.                 {
  26.                     masodik -= elso;
  27.                 }
  28.             }
  29.             Console.WriteLine("LNKO: {0}", elso);
  30.             Console.ReadLine();  
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement