题目:
详解:
#include<bits/stdc++.h> //万能头
using namespace std; //省略std
int main()
{
int x,a,y,b; //声明
cin>>x>>a>>y>>b; //输入
float z=(x*a-y*b)*1.0/(y-x); //声明+赋值小数
printf("%.2f",z); //输出取小数点厚2位并输出
return 0; //结束
}
考点:
printf的应用
题目:
详解:
#include<bits/stdc++.h> //万能头
using namespace std; //省略std
int main()
{
int x,a,y,b; //声明
cin>>x>>a>>y>>b; //输入
float z=(x*a-y*b)*1.0/(y-x); //声明+赋值小数
printf("%.2f",z); //输出取小数点厚2位并输出
return 0; //结束
}
考点:
printf的应用