Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace test
- {
- class Program
- {
- static void Main()
- {
- int[] array;
- Console.Write ("n = ");
- int n = int.Parse (Console.ReadLine ());
- array = new int[n];
- for (int i = 0; i < n; i++) {
- Console.Write ("array[{0}] = ", i);
- array [i] = int.Parse (Console.ReadLine ());
- }
- int count = 0;
- int j = 1;
- for (int i = 0; j <= n - 1; i++, j++)
- if (array [i] < array [j])
- count++;
- Console.WriteLine ("Answer = {0}", count);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment