Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ClatiteGurmand
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int i = 1, clatite = 0, max = 0;
  10.    
  11.             while (i < 11)
  12.             {
  13.                 Console.Write("Gurmandul {0} a mancat: " , i);
  14.                 clatite = Convert.ToInt32(Console.ReadLine());
  15.                 i++;                
  16.             }
  17.  
  18.             int step = 0;
  19.             for (i = 1; i < clatite; i++)
  20.             {
  21.                 if (clatite > max)
  22.                 {
  23.                     max = clatite;
  24.                     step = i;
  25.                 }
  26.             }
  27.             Console.WriteLine("Maximul de clatite " + max + " este mancat de gurmandul {0}", step);
  28.  
  29.             Console.ReadKey();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement