Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CSLight
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int userInput;
- int smallerNumber = 50;
- int largerNumber = 150;
- int smallerDeduction = 10;
- int largerDeduction = 25;
- int quantityNumber = 0;
- Console.WriteLine($"Ваш диапазон чисел ({smallerNumber},{largerNumber})");
- Console.Write($"Введите число (>= {smallerDeduction}) и (<= {largerDeduction}): ");
- userInput = Convert.ToInt32(Console.ReadLine());
- if (userInput < smallerDeduction || userInput > largerDeduction)
- {
- Console.WriteLine($"\nНеверное число. \n");
- return;
- }
- for (int i = 0; i <= largerNumber; i += userInput)
- {
- if (i < smallerNumber)
- {
- continue;
- }
- quantityNumber++;
- }
- Console.WriteLine(quantityNumber);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement