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;
- using System.Threading.Tasks;
- namespace Task16
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Random random = new Random();
- int number;
- int sum = 0;
- int randomMin = 0;
- int randomMax = 101;
- int firstNumberMultiple = 3;
- int secondNumberMultiple = 5;
- number = random.Next(randomMin,randomMax);
- Console.WriteLine(number);
- for (int i = 0; i < number; i++)
- {
- if ((i % firstNumberMultiple) == 0 || (i % secondNumberMultiple) == 0)
- {
- sum += i;
- }
- }
- Console.WriteLine("Конечная сумма равна - " + sum);
- }
- }
- }
Add Comment
Please, Sign In to add comment