From 26bedf2e82579ee793cb437bd4da9370bca7d3df Mon Sep 17 00:00:00 2001 From: hackbard Date: Sat, 4 Jan 2003 14:36:55 +0000 Subject: [PATCH] added fact programm --- fact.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 fact.c diff --git a/fact.c b/fact.c new file mode 100644 index 0000000..f24f40a --- /dev/null +++ b/fact.c @@ -0,0 +1,23 @@ +#include +#include + +int next_teiler(int x) { + int i; + if(x==1) { + printf("\ndone\n"); + exit(0); + } + else { + for(i=2;i<=x;i++) { + if(x%i==0) { + printf("%d ",i); + next_teiler(x/i); + } + } + } +} + +int main(int argc,char *argv[]) { +next_teiler(atoi(argv[1])); +return 0; +} -- 2.39.2