[ create a new paste ] login | about

Link: http://codepad.org/VkWqo0Uj    [ raw code | output | fork ]

C, pasted on Jul 22:
#include <stdio.h>
int main() {
  int n, i;
  printf("> ");
  scanf("%d", &n);
  i = 2;
  if (n < 2) {
    printf("input integer more than 2.\n");
    return 0;
  }
  while (n > 1) {
    if (n % i == 0) {
      printf("%d ", i);
      n /= i;
      continue;
    }
    i++;
  }
  putchar('\n');
  return 0;
}
/* end */


Output:
1
> input integer more than 2.


Create a new paste based on this one


Comments: