Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class MainClass
- {
- public static void Main()
- {
- int n = Convert.ToInt32(Console.ReadLine());
- string[] sinput = Console.ReadLine().Split();
- int[] s = new int[n];
- for (int i = 0; i < n; i++)
- {
- s[i] = Convert.ToInt32(sinput[i]);
- }
- int count = 0;
- for (int i = 0; i < n - 1; i++)
- {
- if (s[i] < s[i + 1])
- {
- count++;
- }
- }
- if (count > 0)
- {
- Console.Write(count + 1);
- }
- else
- {
- if (n == 1)
- {
- Console.Write("1");
- }
- else
- {
- Console.Write("0");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement