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 PossitivesEvenNums
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Въведете n: ");
- int n = int.Parse(Console.ReadLine());
- int brChet = 0;
- int sumPol = 0;
- for (int i = 1; i <= n; i++)
- {
- Console.Write("Въведете {0}-то число: ",i);
- int num = int.Parse(Console.ReadLine());
- if (num > 0)
- {
- sumPol += num;
- }
- if (num % 2 == 0)
- {
- brChet++;
- }
- }
- Console.WriteLine("Сумата на положителните числа е: {0}",sumPol);
- Console.WriteLine("Брося на четните числа е: {0}", brChet);
- Console.Write("\nНатиснете клавиш.....");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment