JuliaPetkova

Untitled

Jun 3rd, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _4_3_05_WeatherForecast
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string num2 = Console.ReadLine();
  14. long num;
  15.  
  16. try
  17. {
  18. num = long.Parse(num2);
  19. }
  20. catch
  21. {
  22. Console.WriteLine("Rainy");
  23. return;
  24.  
  25. }
  26.  
  27. if (num >= byte.MinValue && num <= byte.MaxValue)
  28. {
  29. Console.WriteLine("Sunny");
  30. return;
  31. }
  32. else if (num >= sbyte.MinValue && num <= sbyte.MaxValue)
  33. {
  34. Console.WriteLine("Sunny");
  35. return;
  36. }
  37.  
  38. else if (num >= int.MinValue && num <= int.MaxValue)
  39. {
  40. Console.WriteLine("Cloudy");
  41. return;
  42. }
  43. else if (num >= long.MinValue && num <= long.MaxValue)
  44. {
  45. Console.WriteLine("Windy");
  46. return;
  47. }
  48.  
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment