Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp8
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Hány óra van? ");
- int ora = int.Parse(Console.ReadLine());
- if (6 <= ora && ora < 10)
- {
- Console.WriteLine("Jó reggelt!");
- }
- else if (10 <= ora && ora < 18)
- {
- Console.WriteLine("Jó napot!");
- }
- else if ((18 <= ora && ora <24) ||(0 <= ora && ora < 6))
- {
- Console.WriteLine("Jó estét!");
- }
- else
- {
- Console.WriteLine("Érvénytelen óra! Legközelebb egy 0 és 23 közötti értéket adj meg!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment