Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int a,b,t1,t2,x=0,x2=0;
- scanf("%d %d",&a,&b);
- if(a>0&&b>0)
- {
- x2=1;
- if(a>b)
- {
- t1=a;
- t2=b;
- }
- else
- {
- t1=b;
- t2=a;
- }
- while (t1&&t2)
- {
- t1=t1/10;
- if(t1%10==t2%10)
- {
- x=1;
- }
- else
- {
- x=0;
- }
- t1/=10;
- t2/=10;
- }
- }
- if(x&&x2)
- {
- printf("PAREN");
- }
- else if (!x&&x2)
- printf("NE");
- else if(!x&&!x2)
- {
- printf("Invalid input");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement