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;
- scanf("%d%d", &A, &B);
- if(A <= 0 || B <= 0) {
- printf("Invalid output\n");
- return 0;
- }
- if(A < B) {
- int temp = A;
- A = B;
- B = temp;
- }
- int pozicija = 1;
- int paren_ekvivalent = 1;
- while(A > 0) {
- int cifra = A % 10;
- if(pozicija % 2 == 0) {
- int cifra_od_B = B % 10;
- if(cifra_od_B != cifra) {
- paren_ekvivalent = 0;
- break;
- }
- B /= 10;
- }
- A /= 10;
- pozicija++;
- }
- if(paren_ekvivalent == 0) {
- printf("NE");
- }
- else {
- printf("PAREN");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement