Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int n;
- scanf("%d", &n);
- int tmp = n;
- int broj = 0;
- while(tmp > 0) {
- int cifra = tmp % 10;
- if(cifra % 2 == 0) {
- cifra++;
- }
- broj = (broj * 10) + cifra;
- tmp /= 10;
- }
- int kolega = 0;
- while(broj > 0) {
- int cifra = broj % 10;
- kolega = (kolega * 10) + cifra;
- broj /= 10;
- }
- int prost = 1;
- for(int i = 2; i < kolega; i++) {
- if(kolega % i == 0) {
- prost = 0;
- }
- }
- if(prost == 1) {
- printf("DA\n");
- }
- else {
- printf("NE\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement