Advertisement
ramsess

Prob_5_Weather_Forecast Version 1

Jun 4th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Prob_5_Weather_Forecast
  4. {
  5.     class Prob_5_Weather_Forecast
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.          
  10.             string input = Console.ReadLine( );
  11.            
  12.             if (sbyte.TryParse(input, out sbyte sbytek))
  13.             {
  14.                 Console.WriteLine("Sunny");
  15.             }
  16.             else if (int.TryParse(input, out int intk))
  17.             {
  18.                 Console.WriteLine("Cloudy");
  19.             }
  20.             else if (long.TryParse(input, out long longk))
  21.             {
  22.                 Console.WriteLine("Windy");
  23.             }
  24.             else if (decimal.TryParse(input, out decimal decimalk))
  25.             {
  26.                 Console.WriteLine("Rainy");
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement