Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- // Pex for fun always selects the first comment line.
- public static int Puzzle(int i, int j)
- {
- if(sameSign(i,j)!=sameSign2(i,j))
- {
- throw new Exception();
- }
- return i;
- }
- public static bool sameSign(int num1, int num2)
- {
- return num1 >= 0 && num2 >= 0 || num1 < 0 && num2 < 0;
- }
- public static bool sameSign2(int num1, int num2)
- {
- return (num1 ^ num2) >= 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment