Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3. int a[10000][2],t,i;
  4. scanf("%d", &t);
  5. for (int i = 0; i<t;i++){
  6. for (int j = 0; j<2; j++){
  7. scanf("%d", &a[i][j]);
  8. }
  9. }
  10. i=0;
  11. while (i < t){
  12. if (a[i][0] == a[i][1]){
  13. printf("0\n");
  14. }
  15. else {
  16. if ((a[i][0] % 2) == (a[i][1] % 2)){
  17. if (a[i][0] > a[i][1]){printf("1\n");}
  18. else {printf("2\n");}
  19. }
  20. else {
  21. if (a[i][0]>a[i][1]){printf("2\n");}
  22. else {printf("1\n");}
  23. }
  24. }
  25. i++;
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement