Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace ConsoleTesting
- {
- class ConsoleTesting
- {
- static void Main()
- {
- int first = int.Parse(Console.ReadLine());
- int second = int.Parse(Console.ReadLine());
- int count = 0;
- List<int> collected = new List<int>();
- for (int i = first; i <= second; i++)
- {
- if (i % 5 == 0)
- {
- count++;
- collected.Add(i);
- }
- }
- Console.WriteLine(count);
- foreach (var item in collected)
- {
- Console.Write(item+" ");
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment