Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace labaoop
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. double res;
  13. int first, end, step, i = 1;
  14. Console.WriteLine("Введите начальное число: ");
  15. first = Convert.ToInt32(Console.ReadLine());
  16. Console.WriteLine("Введите последнее число: ");
  17. end = Convert.ToInt32(Console.ReadLine());
  18. Console.WriteLine("Введите шаг: ");
  19. step = Convert.ToInt32(Console.ReadLine());
  20. if (first < 1 || first > 1000 || end > 1000)
  21. {
  22. Console.WriteLine("Ошибка: число должно быть от 1 до 100000");
  23. }
  24. else
  25. {
  26. Console.WriteLine(" Р Е З У Л Ь Т А Т ");
  27. Console.WriteLine("╔══════════╤═════════════╤═════════╗");
  28. Console.WriteLine("║ Номер │ Километр │ Миля ║");
  29. Console.WriteLine("╠══════════╪═════════════╪═════════╣");
  30. do
  31. {
  32. res = first * 0.62;
  33. first += step;
  34. Console.WriteLine("║ {0,3} │ {1,6} │ {2,5:f2} ║", i, first, res);
  35. i++;
  36. } while (first < end);
  37. Console.WriteLine("╚══════════╧═════════════╧═════════╝");
  38. }
  39. Console.ReadKey();
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement