Advertisement
Guest User

3-6-9

a guest
Apr 5th, 2014
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2.  
  3. class ThreeSixNine
  4. {
  5.     static void Main()
  6.     {
  7.         ulong a = ulong.Parse(Console.ReadLine());
  8.         ulong b = ulong.Parse(Console.ReadLine());
  9.         ulong c = ulong.Parse(Console.ReadLine());
  10.         ulong result =0;
  11.         if (b==3)
  12.         {
  13.             result = a+c;
  14.         }
  15.         else if (b==6)
  16.         {
  17.             result = a*c;
  18.         }
  19.         else if (b==9)
  20.         {
  21.             result = a%c;
  22.         }
  23.         if (result%3==0)
  24.         {
  25.             Console.WriteLine(result/3);
  26.         }
  27.         else
  28.         {
  29.             Console.WriteLine(result%3);
  30.         }
  31.         Console.WriteLine(result);
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement