Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp25
- {
- class Program
- {
- public static string SortedNumber(int num)
- {
- int minimum = num % 10;
- num /= 10;
- while (num > 0)
- {
- if (num % 10 < minimum)
- {
- minimum = num % 10;
- num /= 10;
- }
- else
- {
- return "False";
- }
- }
- return "True";
- }
- static void Main(string[] args)
- {
- string result;
- int num;
- Console.WriteLine("Number: ");
- num = int.Parse(Console.ReadLine());
- result = SortedNumber(num);
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement