Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- int rekurzija1(int x, int y, int stepen) {
- if(x == y) {
- return 1;
- }
- if(y > x) {
- return 0;
- }
- return rekurzija1(x, y * stepen, stepen);
- }
- int main()
- {
- int n;
- scanf("%d", &n); // n parovi
- for(int i = 0; i < n; i++) {
- int x, y;
- scanf("%d%d", &x, &y);
- if(y == 0) {
- printf("NE\n");
- continue;
- }
- if(x != 1 && y == 1) {
- printf("NE\n");
- continue;
- }
- if(rekurzija1(x, y, y) == 1) {
- printf("DA\n");
- }
- else {
- printf("NE\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement