Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- namespace CSharp_Shell
- {
- public class Program
- {
- public enum TelepulesMeret
- {
- Hibasbevitel = 0,
- Falu = 1,
- Varos = 5000,
- Nagyvaros = 100000,
- Megapolisz = 2000000
- }
- public static void Main()
- {
- int lelekszam = 1;
- while (lelekszam > 0)
- {
- Console.WriteLine("Kérem adja meg a település lélek számát!" );
- lelekszam = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine(TelepulesTipus(lelekszam) );
- }
- }
- public static TelepulesMeret TelepulesTipus (int lelekszam)
- {
- if (lelekszam < 1)
- return TelepulesMeret.Hibasbevitel;
- if (lelekszam < (int)TelepulesMeret.Varos)
- return TelepulesMeret.Falu;
- if (lelekszam < (int)TelepulesMeret.Nagyvaros)
- return TelepulesMeret.Varos;
- if (lelekszam < (int)TelepulesMeret.Megapolisz)
- return TelepulesMeret.Nagyvaros;
- return TelepulesMeret.Megapolisz;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement