Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace labaoop
- {
- class Program
- {
- static void Main(string[] args)
- {
- double res;
- int first, end, step, i = 1;
- Console.WriteLine("Введите начальное число: ");
- first = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Введите последнее число: ");
- end = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Введите шаг: ");
- step = Convert.ToInt32(Console.ReadLine());
- if (first < 1 || first > 1000 || end > 1000)
- {
- Console.WriteLine("Ошибка: число должно быть от 1 до 100000");
- }
- else
- {
- Console.WriteLine(" Р Е З У Л Ь Т А Т ");
- Console.WriteLine("╔══════════╤═════════════╤═════════╗");
- Console.WriteLine("║ Номер │ Километр │ Миля ║");
- Console.WriteLine("╠══════════╪═════════════╪═════════╣");
- do
- {
- res = first * 0.62;
- first += step;
- Console.WriteLine("║ {0,3} │ {1,6} │ {2,5:f2} ║", i, first, res);
- i++;
- } while (first < end);
- Console.WriteLine("╚══════════╧═════════════╧═════════╝");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement