1 条题解
-
0
C :
#include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a>=b&&a>=c){ printf("%d",a); } if(b>=a&&b>=c){ printf("%d",b); } if(c>=b&&c>=a){ printf("%d",c); } }C++ :
#include<iostream> #include<iomanip> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; if(a>b&&a>c){ cout<<a<<endl; }else if(b>c){ cout<<b<<endl; }else{ cout<<c<<endl; } }Pascal :
var a,b,c,t:longint; begin read(a,b,c); if a<b then begin t:=a;a:=b;b:=t; end; if b<c then begin t:=b;b:=c;c:=t; end; if a<b then begin t:=a;a:=b;b:=t; end; writeln(a); end.Java :
import java.util.Scanner; public class Main { public static void main(String[] args) { @SuppressWarnings("resource") Scanner scanner=new Scanner(System.in); int x=scanner.nextInt(); int y=scanner.nextInt(); int z=scanner.nextInt(); int max; if (x>y) max=x; else max=y; if (x<z) max=z; System.out.println(max); } }Python :
a,b,c = map(int,input().split()); t = a if t < b: t = b; if t < c: t = c; print(t)
- 1
信息
- ID
- 38
- 时间
- 1000ms
- 内存
- 512MiB
- 难度
- 10
- 标签
- 递交数
- 2
- 已通过
- 1
- 上传者