Changeset 115 for trunk/Softwares/Test/Test_099
- Timestamp:
- Apr 20, 2009, 11:29:17 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Softwares/Test/Test_099/src/c/main.c
r102 r115 13 13 #include "func_io.h" 14 14 15 #define mul(x,y) x*y 16 17 unsigned int f1 (unsigned int x) 18 { 19 if ( x <= 1) 20 return 1; 21 22 unsigned int res = mul (x , f1 (x-1)); 23 24 return res; 25 } 26 27 unsigned int f2 (unsigned int x) 28 { 29 unsigned int res= 1; 30 31 while (x > 1) 32 { 33 res = mul(res,x); 34 x --; 35 } 36 return res; 37 } 38 15 39 int main() 16 40 { 17 test_mul_soft (); 18 test_div_soft (); 19 test_modulo (); 20 test_fibonnacci (30); 21 test_n_premier (6); 22 test_factoriel_iteratif (12); 23 test_factoriel_recursif (12); 24 41 for (int i=0; i<500; ++i) 42 if (f2 (12) != 479001600) quit(i); 25 43 quit(0); 26 44 }
Note: See TracChangeset
for help on using the changeset viewer.