Advertisement
Guest User

Untitled

a guest
Mar 31st, 2014
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 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.  
  7. namespace __3_6_9
  8. {
  9.     class Program
  10.     {
  11.         static void Main()
  12.         {
  13.             long a = long.Parse(Console.ReadLine());
  14.             long b = long.Parse(Console.ReadLine());
  15.             long c = long.Parse(Console.ReadLine());
  16.  
  17.             long r = new long();
  18.             long result = new long();
  19.  
  20.             if (b == 3)
  21.             {
  22.                 r = a + c;
  23.             }
  24.  
  25.             else if (b == 6)
  26.             {
  27.                 r = a * c;
  28.             }
  29.  
  30.             else if (b == 9)
  31.             {
  32.                 r = a % c;
  33.             }
  34.  
  35.             else
  36.             {
  37.                 Console.WriteLine("bullshit");
  38.             }
  39.  
  40.             if (r % 3 == 0)
  41.             {
  42.                 result = r / 3;
  43.             }
  44.  
  45.             else
  46.             {
  47.                 result = r % 3;
  48.             }
  49.  
  50.             Console.WriteLine(result);
  51.             Console.WriteLine(r);
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement