Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6. int prv_broj = 0;
  7. int vtor_broj = 0;
  8.  
  9. int main()
  10. {
  11.  
  12. scanf("%d %d",&prv_broj,&vtor_broj);
  13. if(prv_broj < 1 || vtor_broj < 1){
  14. printf("Invalid input");
  15.  
  16. }
  17.  
  18. else{
  19.  
  20. int posledni_broevi;
  21.  
  22. if(prv_broj>vtor_broj){
  23. while(prv_broj){
  24. posledni_broevi = prv_broj%100;
  25. if(vtor_broj/10 != posledni_broevi%10){
  26. printf("NE");
  27. break;
  28. }
  29. vtor_broj/=10;
  30. prv_broj/=100;
  31. }
  32.  
  33.  
  34. printf("PAREN");
  35.  
  36. }
  37.  
  38. if(prv_broj<vtor_broj){
  39. while(prv_broj){
  40. posledni_broevi = vtor_broj%100;
  41. if(prv_broj/10 != posledni_broevi%10){
  42. printf("NE");
  43. break;
  44. }
  45. prv_broj/=10;
  46. vtor_broj/=100;
  47. }
  48.  
  49. }
  50. printf("PAREN");
  51.  
  52. }
  53.  
  54.  
  55.  
  56.  
  57.  
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement