Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace newtasks
- {
- class Program
- {
- static public bool isSorted(int[] array)
- {
- bool sorted = true;
- for (int i = 0; i < array.Length - 1; i++)
- {
- if (array[i] < array[i + 1])
- {
- continue;
- }
- else
- {
- sorted = false;
- }
- }
- return sorted;
- }
- public static void Main(String[] args)
- {
- int n = int.Parse(Console.ReadLine());
- string[] print = new string[n];
- for (int i = 0; i < n; i++)
- {
- string[] list = Console.ReadLine().Split(',');
- int[] conv = new int[list.Length];
- for (int j = 0; j < list.Length; j++)
- {
- conv[j] = int.Parse(list[j]);
- }
- print[i] = Convert.ToString(isSorted(conv));
- }
- foreach(string value in print)
- {
- Console.WriteLine(value);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement