Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4. static void Main(string[] args)
  5. {
  6. int getal = int.Parse(Console.ReadLine());
  7. if (getal == 0)
  8. {
  9. Console.Write("0" + " " + "0");
  10. }
  11. else
  12. {
  13. int kleinste = 0;
  14. int grootste = 0;
  15. while (getal != 0)
  16. {
  17. getal = int.Parse(Console.ReadLine());
  18. if (getal > grootste)
  19. {
  20. grootste = getal;
  21. }
  22. else
  23. {
  24. if (getal < kleinste)
  25. {
  26. kleinste = getal;
  27. }
  28. }
  29. }
  30. Console.Write(kleinste + " " + grootste);
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement