kuruku

2-4-8

Apr 14th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Numerics;
  7.  
  8. namespace _2_4_8
  9. {
  10.     class _2_4_8
  11.     {
  12.         static void Main()
  13.         {
  14.             Console.Write("a = ");
  15.             BigInteger a = BigInteger.Parse(Console.ReadLine());
  16.             Console.Write("b = ");
  17.             BigInteger b = BigInteger.Parse(Console.ReadLine());
  18.             Console.Write("c = ");
  19.             BigInteger c = BigInteger.Parse(Console.ReadLine());
  20.             BigInteger R = 0;
  21.  
  22.             if (b == 2)
  23.             {
  24.                 R = a % c;
  25.  
  26.             }
  27.             if (b == 4)
  28.             {
  29.                 R = a + c;
  30.             }
  31.             if (b == 8)
  32.             {
  33.                 R = a * c;
  34.             }
  35.             if (R % 4 == 0)
  36.             {
  37.                 Console.WriteLine(R / 4);
  38.             }
  39.             else
  40.             {
  41.                 Console.WriteLine(R % 4);
  42.             }
  43.             Console.WriteLine(R);
  44.  
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment