0
已解决
左文彬
新手光能
新手光能
题目链接: 酷町堂:8342
#include<bits/stdc++.h>
using namespace std;
void f(double a,double b){
double csl=a/(a+5000000-b)*1000;
double swl=b/(a+5000000-b)*1000;
printf("%.2f",csl-swl);
}
int main()
{
int a;
double x,y;
cin>>a;
for(int i=1;i<=a;i++){
cin>>x>>y;
f(x,y);
cout<<endl;
}
}
两个代码
- #include<bits/stdc++.h>
- using namespace std;
- double f(double a,double b){
- double csl=a/(a+5000000-b)*1000;
- double swl=b/(a+5000000-b)*1000;
- return csl-swl;
- }
- int main()
- {
- int a; double x,y;
- cin>>a
- for(int i=1;i<=a;i++){
- cin>>x>>y;
- printf("%.2f",f(x,y));
- cout<<endl;
- }
- }