Advertisement
GraionDilach

Tömbbe beolvasás, ki maximum

Oct 17th, 2011
185
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 ConsoleApplication4
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.  
  13.             int[] array = new int[10];
  14.  
  15.             for (int i = 0; i < array.Length; i++)
  16.             {
  17.                 //ellenőrzött bevitel
  18.                 do
  19.                 {
  20.                     Console.WriteLine("Kérem a " + (i + 1) + ". számot.");
  21.                     array[i] = int.Parse(Console.ReadLine());
  22.                 } while (array[i] > 0);
  23.  
  24.             }
  25.             //kiírás:
  26.             Console.WriteLine("A maximum: " + array.Max());
  27.  
  28.         }
  29.     }
  30. }
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement