这个Dev?
M27****9612
2021-09-10 06:07
程序能够编译、运行了。改正后的程序如下:#include<bits/stdc++.h>using namespace std;int maxn(int,int,int);int main(){int a,b,c;double m;cin>>a>>b>
M27****9612
2021-09-10 06:07
程序能够编译、运行了。改正后的程序如下:#include<bits/stdc++.h>using namespace std;int maxn(int,int,int);int main(){int a,b,c;double m;cin>>a>>b>>c;m=double(maxn(a,b,c))/(double(maxn(a+b,b,c)*maxn(a,b,b+c)));printf("%.3f
",m);return 0;}int maxn(in开发者_高级运维t v,int f,int g){int max1=v;if(f>max1) max1=f;if(g>max1) max1=g;return max1;}按你的程序修改了:①函数声明语句后加了分号:int maxn(int,int,int);②对max1作了强制类型转换m=double(maxn(a,b,c))/(double(maxn(a+b,b,c)*maxn(a,b,b+c)));程序的运行结果例如下:
0
0
0
精彩评论