Advertisement
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 _08.MetricConverter
- {
- class Program
- {
- static void Main(string[] args)
- {
- double countOfInputs = double.Parse(Console.ReadLine());
- int previousNumber = 0;
- int currentNumber = 0;
- int countOfCurrentIncreasingSequence = 1;
- int countOfBestIncreasingSequence = 0;
- for (int currentInput = 0; currentInput < countOfInputs; currentInput++)
- {
- previousNumber = currentNumber;
- currentNumber = int.Parse(Console.ReadLine());
- if (currentInput == 0)
- {
- countOfBestIncreasingSequence = 1;
- continue;
- }
- if (currentNumber > previousNumber)
- {
- countOfCurrentIncreasingSequence++;
- }
- else
- {
- countOfCurrentIncreasingSequence = 1;
- }
- if (countOfCurrentIncreasingSequence > countOfBestIncreasingSequence)
- {
- countOfBestIncreasingSequence = countOfCurrentIncreasingSequence;
- }
- }
- Console.WriteLine(countOfBestIncreasingSequence);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement