C程序设计(第四版)第一章习题

版权声明:转载请注明出处 https://blog.csdn.net/nanhuaibeian/article/details/86544156
  1. 编写C程序,输入a,b,c三个值,输出其中的最大者
# include <stdio.h>
int main()
{
	int a,b,c,max;
	printf("请输入a,b,c的值(以逗号隔开):");
	scanf("%d,%d,%d",&a,&b,&c);
	if(a>b){
		if(a>c)	max = a;
		else max = c;
	}
	else{
		if(b>c)	max = b;
		else max = c; 
	}
	printf("a,b,c的最大值为:%d",max);
	
	return 0; 
}

猜你喜欢

转载自blog.csdn.net/nanhuaibeian/article/details/86544156
今日推荐