SHARE
TWEET

minosegbiztositasfeladat (C# Shell App Paste)

jani12345 Oct 18th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
  2. using System;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Collections.Generic;
  6.  
  7. namespace CSharp_Shell
  8. {
  9.                    
  10. public class Program
  11. {
  12.     public enum TelepulesMeret
  13.     {
  14.         Hibasbevitel = 0,
  15.         Falu = 1,
  16.         Varos = 5000,
  17.         Nagyvaros = 100000,
  18.         Megapolisz = 2000000
  19.     }
  20.    
  21.     public static void Main()
  22.     {
  23.         int lelekszam = 1;
  24.         while (lelekszam > 0)
  25.         {
  26.         Console.WriteLine("Kérem adja meg a település lélek számát!" );
  27.         lelekszam = Convert.ToInt32(Console.ReadLine());
  28.        
  29.         Console.WriteLine(TelepulesTipus(lelekszam) );
  30.         }
  31.     }
  32.                          
  33.     public static   TelepulesMeret TelepulesTipus   (int lelekszam)
  34.     {
  35.         if (lelekszam < 1)
  36.             return TelepulesMeret.Hibasbevitel;
  37.            
  38.         if (lelekszam < (int)TelepulesMeret.Varos)
  39.             return TelepulesMeret.Falu;
  40.            
  41.         if (lelekszam < (int)TelepulesMeret.Nagyvaros)
  42.             return TelepulesMeret.Varos;
  43.                
  44.         if (lelekszam < (int)TelepulesMeret.Megapolisz)
  45.             return TelepulesMeret.Nagyvaros;
  46.            
  47.         return TelepulesMeret.Megapolisz;
  48.     }
  49. }
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top