projects
/
my-code
/
beginners.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62e4aa7
)
added fact programm
author
hackbard
<hackbard>
Sat, 4 Jan 2003 14:36:55 +0000
(14:36 +0000)
committer
hackbard
<hackbard>
Sat, 4 Jan 2003 14:36:55 +0000
(14:36 +0000)
fact.c
[new file with mode: 0644]
patch
|
blob
diff --git a/fact.c
b/fact.c
new file mode 100644
(file)
index 0000000..
f24f40a
--- /dev/null
+++ b/
fact.c
@@ -0,0
+1,23
@@
+#include <stdio.h>
+#include <math.h>
+
+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;
+}