Advertisement
Lisaveta777

done, quite easy

Jan 8th, 2020
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. //https://otvet.mail.ru/question/218027254
  4.  
  5. int main()
  6. {
  7.     int count,flag;//2,2,3
  8.     double i,n = 28;
  9.  
  10.     count = flag = 0;
  11.  
  12.     for(i=2;i<=n;i++)
  13.     {
  14.         if(i==n&&!flag)
  15.         {
  16.             printf("sorry,it's not\n");
  17.         }
  18.         else if(!fmod(n,i))
  19.         {
  20.             printf("%c %d  ",(!flag)?' ':'*',(int)i);
  21.             n/=i--;
  22.             flag++;
  23.             count++;
  24.         }
  25.         else if(n<10)//if cifra
  26.         {
  27.            printf("* %d\nhurray,it dividable!\n",(int)n);
  28.            i=n;
  29.            count++;
  30.         }
  31.  
  32.     }
  33.     printf("dividers count is-%d\n",count);
  34.  
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement