Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a, b,min,max,i=1,senkanamax,cifranamax,senkanamin,cifranamin,proveruvac=0,MIN=0;
- scanf("%d%d", &a, &b);
- if (a <= 0 || b <= 0) {
- printf("Invalid input");
- }
- else {
- if (a < b) {
- min = a;
- max = b;
- }
- else if (b < a) {
- min = b;
- max = a;
- }
- senkanamin = min;
- while (senkanamin > 0) {
- cifranamin = senkanamin % 10;
- senkanamax = max;
- while (senkanamax > 0) {
- cifranamax = senkanamax % 10;
- if (i % 2 == 0) {
- if (cifranamax == cifranamin) {
- proveruvac++;
- }
- }
- senkanamax = senkanamax / 10;
- i++;
- }
- senkanamin = senkanamin / 10;
- MIN++;
- }
- if (MIN == proveruvac) {
- printf("PAREN");
- }
- else {
- printf("NE");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement