Advertisement
jovanovski

Прости Делители

Nov 5th, 2011
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3. int a,b, i;
  4. printf("vensi broj: ");
  5. scanf("%d", &a);
  6. b=a;
  7. i=1;
  8. printf("%d = ", a);
  9. while(1){
  10.     i++;
  11.     if ((a%i)==0) {
  12.     printf("%d ", i);
  13.     a/=i;
  14.     i=1;
  15.     break;
  16.     }
  17. }
  18. while(1){
  19.     i++;
  20.     if ((a%i)==0) {
  21.     printf("* %d ", i);
  22.     a/=i;
  23.     i=1;
  24.     }
  25.     if(i>=b)
  26.     {
  27.         break;
  28.     }
  29. }
  30.  
  31.  
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement