Advertisement
radidim

P01.test (C# Shell App Paste)

Jul 13th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.65 KB | None | 0 0
  1. //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
  2. using System;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Collections.Generic;
  6.  
  7. namespace CSharp_Shell
  8. {
  9.  
  10.     public static class Program
  11.     {
  12.         public static void Main()
  13.         {
  14.             int a = int.Parse(Console.ReadLine());
  15.             int b= int.Parse(Console.ReadLine());
  16.             int c = int.Parse(Console.ReadLine());
  17.             if(a==b&&a==c&&c==a)
  18.             {
  19.                 Num(b,c);
  20.                 Console.Write($"\n{a}\n{b}\n{c}");
  21.                 return;
  22.             }
  23.            
  24.                 if(a>=b && a>= c && b>=c)
  25.                 {
  26.                     Console.Write($"\n{a} \n{b} \n{c}");
  27.                 }
  28.                 else if(a>=b && a>=c && c>=b)
  29.                 {
  30.                     Console.Write($"\n{a} \n{c} \n{b}");
  31.                 }
  32.                
  33.                 if(b>=a && b>=a && a>=c)
  34.                 {
  35.                   Console.Write($"\n{b}\n{a}\n{c}");
  36.                 }
  37.                 else if(b>=a && b>=c && c>=a)
  38.                 {
  39.                     Console.Write($"\n{b}\n{c}\n{a}");
  40.                 }
  41.                
  42.                 if(c>=a && c>=b && a>=b)
  43.                 {
  44.                     Console.Write($"\n{c}\n{a}\n{b}");
  45.                 }
  46.                 else if(c>=a && c>=b && b>=a)
  47.                 {
  48.                   Console.Write($"\n{c}\n{b}\n{a}");
  49.                 }
  50.                
  51.         }
  52.         private static int Num( int b, int c)
  53.         {
  54.             if(b>=c)
  55.             {
  56.                 return b;
  57.             }
  58.             else
  59.             {
  60.                 return c;
  61.             }
  62.         }
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement