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 deliteli = 0;
- for(int i = 1; i <= kolega; i++) {
- if(kolega % i == 0) {
- deliteli++;
- }
- }
- if(deliteli == 2) { // prost
- printf("DA\n");
- }
- else {
- printf("NE\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement