Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Task374
- {
- using System;
- using System.Numerics;
- class Task374_1
- {
- static void Main(string[] args)
- {
- //first condition
- int k = int.Parse(Console.ReadLine());
- bool isLoopExit = false;
- double sum = 0;
- while (!isLoopExit)
- {
- double input = double.Parse(Console.ReadLine());
- sum += input;
- if (input == 0)
- {
- isLoopExit = true;
- }
- }
- Console.WriteLine(sum);
- //second condition
- double multiply = 1;
- for (int i = 0; i < 10; i++)
- {
- double input = double.Parse(Console.ReadLine());
- if (input >= 2 && input <= 12)
- {
- multiply *= input;
- }
- }
- Console.WriteLine(multiply);
- //third condition
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- int c = int.Parse(Console.ReadLine());
- BigInteger result = Sum(a * b) + Sum(c);
- Console.WriteLine(result);
- }
- static BigInteger Sum(int k)
- {
- BigInteger evenSum = 0;
- Random rnd = new Random();
- for (int i = 0; i < k; i++)
- {
- int num = rnd.Next(int.MinValue, int.MaxValue);
- evenSum += num * (1 - (num % 2));
- }
- return evenSum;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement