MuffinMonster

Class Task 28#

Oct 30th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.31 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int i, max = 0, max1 = 0, maxall = 0;
  13.             int num1, num2, num3;
  14.             for (i = 1; i <= 3; i++)
  15.             {
  16.                 Console.Write("Num1: ");
  17.                 num1 = int.Parse(Console.ReadLine());
  18.                 Console.Write("Num2: ");
  19.                 num2 = int.Parse(Console.ReadLine());
  20.                 Console.Write("Num3: ");
  21.                 num3 = int.Parse(Console.ReadLine());
  22.                 max = Math.Max(num1, num2);
  23.                 max1 = Math.Max(max, num3);
  24.                 Console.WriteLine("At group number " + i + " highest number was " + max1);
  25.                 if (max1 >= 0)
  26.                 {
  27.                     Console.WriteLine((int)Math.Sqrt(max1));
  28.                 }
  29.                 else
  30.                 {
  31.                     Console.WriteLine("No shoresh!");
  32.                 }
  33.                 maxall = Math.Max(max1, maxall);
  34.                 if (maxall == max1)
  35.                 {
  36.                     Console.WriteLine("Max number appeared in group number " + i);
  37.                 }
  38.             }
  39.             Console.ReadLine();
  40.         }
  41.     }
  42. }
Add Comment
Please, Sign In to add comment