编程:从键盘输入三位数,找出它们的最大数.
来源:百度知道 编辑:UC知道 时间:2024/05/09 19:46:45
int a,b,c;//输入的三个数
int temp=a;
if(temp<b)
temp=b;
if(temp<c)
temp=c;
printf(temp);
大体就这样子了
#include<stdio.h>
int main()
{
double x,y,z,max;
printf("输入3个数,以空格分开\n");
scanf("%lf %lf %lf",&x,&y,&z);
max=x>y?x:y;
max=max>z?max:z;
printf("最大的数是%lf",max);
return 0;
}
dim a as integer,b as integer, c as integer
a=inputbox ("a=")
b=inputbox("b=")
c=inputbox("c=")
max=a
if max<b then max=b
if max<c then max=c
用VB的