我有这个代码:
#include<stdio.h>
#include<conio.h>
#include<math.h>
float sinfa(num1, num2)
{
float fc;
float powers;
if(num1 == ""){
powers = pow(num2,4);
}else{
powers = pow(num1,4);
}
fc = sin(num1-powers+1);
return (fc);
}
float tp(fa,fb,num1,num2)
{
float p;
float fm2 = fa*num2;
float fm1 = fb*num1;
p = (fm2-fm1)/(fa-fb);
printf("%f",fa);
return (p);
}
float main()
{
double num1;
double num2;
float fa;
float fb;
float p1;
clrscr();
printf("Enter number 1: \n");
scanf("%d", &num1);
getch();
printf("Enter number 2: \n");
scanf("%d", &num2);
getch();
clrscr();
fa = sinfa(num1);
printf("%f \n",fa);
getch();
fb = sinfa(num2);
printf("%f",fb);
getch();
clrscr();
p1 = tp(fa,fb,num1,num2);
printf("%f",p1);
getch();
}
我一直从函数 tp 得到 0,当我向他们发送任何想法时,参数没有输入,为什么?因为对于 sinfa,参数被发送并返回一个值
谢谢你