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,i,pom,cifra,zbir,j,brdelitel;
- printf("vnesi obsek od do\n");
- scanf("%d%d",&a, &b);
- for ( i=a; i<=b ; i++) {
- pom=i;
- zbir=0;
- brdelitel=0;
- while (pom!=0){
- cifra=pom%10;
- pom/=10;
- zbir+=cifra;
- }
- for (j=1; j<=zbir ; j++) {
- if (zbir%j==0)
- brdelitel++;
- }
- if (brdelitel==2)
- printf("brojot e %d",i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement