#include<stdio.h>

#include<math.h>

int main(void)

{

int money,year;

double rate,sum;

printf("Enter money:");

scanf("%d",&money);

printf("Enter year:");

scanf("%d",&year);

printf("Enter rate:");

scanf("%lf",&rate);

sum=money*pow(1+rate,year);

printf("sum=%.2f\n",sum);

return 0;

}

#include<stdio.h>

#include<math.h>

int main(void)

{

double x,y;

printf("Enter x:\n");

scanf("%lf",&x);

if(x<0){

y=pow(x,5)+2*x+pow(x,-1);

}

else {

y=sqrt(x);

}

printf("y=f(%f)=%.2f\n",x,y);

return 0;

}

完成此次作业用了相对上次更长的时间,上了2次课后能感觉到有一些东西都是相通的

05-11 15:50