MuffinMonster

Class Task 26#

Oct 30th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int daycounter = 0, temperature, maxtemp = 0, hospital = 0;
  13.             int check;
  14.             Console.WriteLine("Check the amount of day you want to check: ");
  15.             check = int.Parse(Console.ReadLine());
  16.             {
  17.                 for (int i = 0; i < check; i++)
  18.                 {
  19.                     Console.WriteLine("Enter the temperature:");
  20.                     temperature = int.Parse(Console.ReadLine());
  21.                     maxtemp = Math.Max(maxtemp, temperature);
  22.                     if (temperature != 36)
  23.                         daycounter++;
  24.                     if (temperature <= 35 || temperature >= 40)
  25.                         hospital++;
  26.                 }
  27.                 Console.WriteLine("Person was sick " + daycounter + " days, his highest temperature was " + maxtemp);
  28.                 Console.WriteLine("He was " + hospital + " at the hospital");
  29.                 Console.ReadLine();
  30.             }
  31.         }
  32.     }
  33. }
Add Comment
Please, Sign In to add comment