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;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int daycounter = 0, temperature, maxtemp = 0, hospital = 0;
- int check;
- Console.WriteLine("Check the amount of day you want to check: ");
- check = int.Parse(Console.ReadLine());
- {
- for (int i = 0; i < check; i++)
- {
- Console.WriteLine("Enter the temperature:");
- temperature = int.Parse(Console.ReadLine());
- maxtemp = Math.Max(maxtemp, temperature);
- if (temperature != 36)
- daycounter++;
- if (temperature <= 35 || temperature >= 40)
- hospital++;
- }
- Console.WriteLine("Person was sick " + daycounter + " days, his highest temperature was " + maxtemp);
- Console.WriteLine("He was " + hospital + " at the hospital");
- Console.ReadLine();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment