Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TwoFourEight
- {
- class TwoFourEight
- {
- static void Main()
- {
- ulong a = ulong.Parse(Console.ReadLine());
- ulong b = ulong.Parse(Console.ReadLine());
- ulong c = ulong.Parse(Console.ReadLine());
- ulong r = 0;
- ulong result = 0;
- if (b == 2)
- {
- r = a % c;
- }
- else if (b == 4)
- {
- r = a + c;
- }
- else if (b == 8)
- {
- r = a * c;
- }
- if (r % 4 == 0)
- {
- result = r / 4;
- Console.WriteLine(result);
- Console.WriteLine(r);
- return;
- }
- else
- {
- result = r % 4;
- Console.WriteLine(result);
- Console.WriteLine(r);
- return;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment