Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (x < 0) { // check negative number
- x = x * -1;
- }
- if (y < 0) { // check negative number
- y = y * -1;
- }
- if ((x==0||y==0) || (x<10&&y<10)) { // check zero case and one digit case
- if (x!=y) {
- return 0;
- } else if (x==y) {
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement