程序:

//编写一个程序,输入a,b,c三个值,输出其中最大者

#include<stdio.h>

int main()

{

  int a,b,c,max;

  printf("请输入三个数:");

  scanf("%d,%d,%d",&a,&b,&c);

  max=a;

  if (max<b)

   {

      max=b;

   }

  if (max<c) 

   {   

   max=c;

   }

  printf("%d\n",max);

  return 0;

}

结果:

请输入三个数:-1,2,45

45

 

 

 

             Press any key to continue