MuffinMonster

Class Task 30#

Oct 30th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication2
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int jump, winner = 0, maxjump = 0;
  13.             for (int i = 1; i <= 8; i++)
  14.             {
  15.                 jump = int.Parse(Console.ReadLine());
  16.                 maxjump = Math.Max(jump, maxjump);
  17.                 if (maxjump == jump)
  18.                 {
  19.                     winner = i;
  20.                 }
  21.             }
  22.             Console.WriteLine("Student number " + winner + " jumped the max, he jumped " + maxjump + " meters");
  23.             Console.ReadLine();
  24.         }
  25.     }
  26. }
Add Comment
Please, Sign In to add comment