Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int a, b,min,max,i=1,senkanamax,cifranamax,senkanamin,cifranamin,proveruvac=0,MIN=0;
  6. scanf("%d%d", &a, &b);
  7. if (a <= 0 || b <= 0) {
  8. printf("Invalid input");
  9. }
  10. else {
  11. if (a < b) {
  12. min = a;
  13. max = b;
  14. }
  15. else if (b < a) {
  16. min = b;
  17. max = a;
  18. }
  19. senkanamin = min;
  20. while (senkanamin > 0) {
  21. cifranamin = senkanamin % 10;
  22. senkanamax = max;
  23. while (senkanamax > 0) {
  24. cifranamax = senkanamax % 10;
  25. if (i % 2 == 0) {
  26. if (cifranamax == cifranamin) {
  27. proveruvac++;
  28. }
  29. }
  30. senkanamax = senkanamax / 10;
  31. i++;
  32. }
  33. senkanamin = senkanamin / 10;
  34. MIN++;
  35. }
  36. if (MIN == proveruvac) {
  37. printf("PAREN");
  38. }
  39. else {
  40. printf("NE");
  41. }
  42. }
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement