一道C语言编程题:(大家帮着查错)

来源:百度知道 编辑:UC知道 时间:2024/05/25 13:35:11
#include "stdio.h"
main()
{
int a,b,max;
printf("enter the number 'a' and 'b':\n");
scanf("%d %d",&a,&b);
max=a;
if(a<b) max=b;
printf("max");
}

printf("max=%d",max);

#include "stdio.h"
void main()
{
int a,b,max;
printf("enter the number 'a' and 'b':\n");
scanf("%d %d",&a,&b);
max=a;
if(a<b)
{max=b;
printf("%d\n",max);
}
else printf("%d\n",max);
}
#include "stdio.h"
int main()
{
int a,b,max;
printf("enter the number 'a' and 'b':\n");
scanf("%d %d",&a,&b);
max=a;
if(a<b)
{
max=b;
printf("%d\n",max);
}
else
printf("%d\n",max);
return 0;
}

是比2个数中最大的程序..。你的程序不对啊
#include <iostream>
using namespace std;
int main()
{
int a,b,max;
cout<<"enter the number a and b"<<endl;
cin>>a>>b;
max=a;
if(a<b)<