Advertisement
EndymionSpr

Untitled

Nov 8th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp1
  8. {
  9. class Program
  10. {
  11. static uint Maciek_1(uint a, uint b)
  12. {
  13. while (a != b)
  14.  
  15. if (a > b)
  16. a -= b;
  17. else
  18. b -= a;
  19. return a;
  20.  
  21.  
  22. }
  23.  
  24. static void Maciek_2()
  25. {
  26. Console.BackgroundColor = ConsoleColor.Blue;
  27. Console.ForegroundColor = ConsoleColor.Yellow;
  28. Console.Clear();
  29. }
  30.  
  31. static uint Maciek_A(string Komunikat)
  32. {
  33. Console.WriteLine(Komunikat);
  34. return uint.Parse(Console.ReadLine());
  35.  
  36. }
  37. static void Main(string[] args)
  38. {
  39.  
  40. Maciek_2();
  41.  
  42. uint a = Maciek_A()("Podaj a.");
  43.  
  44. uint b = Maciek_A()("Podaj b.");
  45.  
  46.  
  47. Console.WriteLine("NWD (" + a +"," + b + ")wynosi: "+ Maciek_1(a, b));
  48.  
  49.  
  50. Console.ReadKey();
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement