M27****9612
优艾设计网_Photoshop问答
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(int 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)));程序的运行结果例如下:
这个Dev?
M27****9612
优艾设计网_Photoshop问答
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;c
0
0
0
精彩评论