diff --git a/e^x.cpp b/e^x.cpp new file mode 100644 index 0000000..7c90c41 --- /dev/null +++ b/e^x.cpp @@ -0,0 +1,25 @@ +#include +#include +main() +{ +int x; +double y; +printf("Please input x:"); +scanf("%d", &x); +if (x > 0) +{ +y = exp(x); +} +else if (x< 0) +{ +y = exp(x); +} +else +{ +printf("y==1\n"); +} +printf("y=%f\n", y); +} + + + diff --git a/测试1.cpp b/测试1.cpp deleted file mode 100644 index 968662f..0000000 --- a/测试1.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include -#define pi 3.14 - -int main() -{ - int a; - double b; - printf("ÇëÊäÈëÄãÒª¼ÆËãµÄ½Ç¶È:"); - scanf("%d",&a); - b=a*pi/180; - printf("%f\n",sin(b)) ; - printf("%f\n",cos(b)) ; - printf("%f\n",tan(b)) ; - return 0; - - } - - - -