striking

3-6-9

Dec 7th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1.  
  2.  
  3. using System;
  4. using System.Numerics;
  5. class ThreeSixNine
  6. {
  7.     static void Main()
  8.     {
  9.         int A = int.Parse(Console.ReadLine());
  10.         int B = int.Parse(Console.ReadLine());
  11.         int C = int.Parse(Console.ReadLine());
  12.         BigInteger R = 0;
  13.         BigInteger answerR = 0;
  14.  
  15.         if (B == 3)
  16.         {
  17.             R = A + C;
  18.         }
  19.  
  20.         if (B == 6)
  21.         {
  22.             R = (BigInteger)A * C;
  23.         }
  24.  
  25.         if (B == 9)
  26.         {
  27.             R = A % C;
  28.         }
  29.  
  30.         if (R % 3 == 0)
  31.         {
  32.             answerR = R / 3;
  33.             Console.WriteLine(answerR);
  34.         }
  35.  
  36.         if (R % 3 != 0)
  37.         {
  38.             answerR = R % 3;
  39.             Console.WriteLine(answerR);
  40.         }
  41.  
  42.         Console.WriteLine(R);
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment