Advertisement
fattboy

CSLT_3_7

Oct 1st, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<math.h>
  4. void main()
  5. {
  6. int kt,n,i,dem=0;
  7. clrscr();
  8. printf("\nNhap n ");
  9. scanf("%d",&n);
  10.     printf("%d = ",n);
  11. i=2;dem=0;
  12. while(n>1)
  13. {
  14. if(n%i==0)
  15. {
  16. n=n/i;
  17. ++dem;
  18. }
  19. if (n%i!=0 || n==1)
  20. {
  21.  
  22. while(dem!=0)
  23. {
  24. printf("(%d,%d)",i,dem);
  25. break;
  26. }
  27. ++i;
  28. dem=0;
  29. }
  30. }
  31. getch();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement