这个程序的第 7 行不是“pay = prt(pay);”吗?应该抛出编译或运行时错误,因为它将 int 传递给需要双精度的参数?我用 dev-c++ 很好地编译了它,并用两行输出运行了程序。请解释一下,谢谢。
#include <stdio.h>
int prt(double b);
main ()
{
int pay = 3;
double tax = 2.2;
pay = prt(pay);
prt(tax);
}
int prt(double b)
{
b *= 2;
printf("%.2lf\n", b);
}