3085:练15.3 最大的数
练 15.3 最大的数
2056:【例3.7】最大的数
C语言代码:
#include <stdio.h>
#include <stdlib.h>
int main(void){
double a,b,c,maxx;
scanf("%lf%lf%lf",&a,&b,&c);
if(a>b)
{
maxx=a;
}
else
{
maxx=b;
}
if(maxx<c)
{
maxx=c;
}
printf("%g",maxx);
return 0;
}
C++代码:
#include<bits/stdc++.h>
using namespace std;
double a,b,c,maxx;
int main()
{
cin>>a>>b>>c;
maxx=a;
if( b > maxx ) maxx=b;
if( c > maxx ) maxx=c;
cout<<maxx;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
double a,b,c;
cin>>a>>b>>c;
if(a>=b){
if(a>=c) cout<<a;
else cout<<c;
}else{
if(b>=c) cout<<b;
else cout<<c;
}
return 0;
}
#include<iostream>
using namespace std;
int main(){
double a,b,c;
cin>>a>>b>>c;
if(a>b&&a>c){
cout<<a;
}
if(b>a&&b>c){
cout<<b;
}
if(c>a&&c>b){
cout<<c;
}
return 0;
}
python3代码:
x,y,z=input().split()
x=float(x)
y=float(y)
z=float(z)
if x>y:
maxx=x
else:
maxx=y
if maxx<z:
maxx=z
print("%g"%maxx)
C++入门、STL学习、二级C++等
信息学奥赛中的STL(标准模板库)--2022.09.30
【建议收藏】CSP-J/S 第一轮认证考前 1 天必看注意事项!
【CSP倒计时】想过初赛?这份高分秘籍必须要看
CSP-J/S 初赛“骗分”攻略!