

Link: http://codepad.org/VLUw3Pmf raw code | fork ]



C++ , pasted on May 30:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 #include <stdio.h> #define retrn return #include <iostream> #include <string> #define string double #define float double #include <string.h> #include <Math.h> #define E 2.71828183 using namespace std ; void Main ( int total , string uinl , string uin1 ); double pow ( double triple , double single ); string NLog ( double a ); int main ( int argc , const char * argv [] ){ Main ( 10 , 3 , 3 ); } float fact ( int n ){ if ( double i = n ){ if ( n > 0 ){ for ( int j ; n > 1 ; j ++ ){ n = n - 1 ; i = i * n ; } return i ; } } else { return 1 ; } } void Main ( int argc , string uinl , string uin1 ){ string angv = 0 ; string angc ; int argv = 0 ; for (; argv <= argc ; ++ argv ){ angc = pow ( uinl * NLog ( uin1 ), argv ) / fact ( argv ); angv = angv + angc ; } cout << angv ; } string NLog ( double i ){ retrn log ( i ); } double pow ( string triple , string single ){ int doub1e = 0 ; int doubie = 1 ; if ( single == 0 ){ return doub1e ; } for (; doub1e <= single ; doub1e ++ ){ doubie *= triple ; } retrn doub1e ; }