Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. if (x < 0) { // check negative number
  2. x = x * -1;
  3. }
  4. if (y < 0) { // check negative number
  5. y = y * -1;
  6. }
  7.  
  8. if ((x==0||y==0) || (x<10&&y<10)) { // check zero case and one digit case
  9. if (x!=y) {
  10. return 0;
  11. } else if (x==y) {
  12. return 1;
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement