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 ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string family;
- int num, min = 99999999, total = 0, sum = 0, zugi = 0, join,max = 0;
- Console.WriteLine("Enter the amount of families joining the survey:");
- join = int.Parse(Console.ReadLine());
- for (int i = 0; i < join; i++)
- {
- family = Console.ReadLine();
- num = int.Parse(Console.ReadLine());
- total++;
- max = Math.Max(max, num);
- if (max == num)
- Console.WriteLine(family);
- min = Math.Min(min, num);
- sum = sum + num;
- if (num % 2 == 0)
- zugi++;
- }
- Console.WriteLine("Minimum number: " + min);
- Console.WriteLine((double)sum / total);
- Console.WriteLine(zugi + " chose number zugi!");
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment