用if可以这么写:includeint main(void){int a,b,c,_max;scanf("%d%d%d",&a,&b,&c);if(a>b){if(a>c)max=a;elsemax=c;}else if(a){if(b>c)max=b;elsemax=c;}printf("Max:%d\\n",_max);return 0;}用qsort函数可以快速排序,算法如下:includeincludeint cmp(const void*a,const void*b){return(*(int*)a-*(int*)b);}int main(void){int a[4];for(int i=0;i;i+)scanf("%d",&a[i]);qsort(a,3,sizeof(a[0]),cmp);printf("Max:%d",a[2]);return 0;}还有更多的方法就不说了www.mh456.com防采集。
#include void fun_a(int i) // fun_a求整数个数的函数 {int k = printf("%d",i);printf("的个数是%d.\n",k);}void fun_b(int i) // fun_b打印整数每一位的函数 { int k = i / 10;if(k != 0){fun_b(k); }printf("%d\n",i%10);}void fun_c(int i) // fun_c倒序输出整数的的函数 {while(i){printf("%d",i % 10);i /= 10; }printf("\n");}int main() // 主函数 {int a;scanf("%d",&a);fun_a(a);fun_b(a);fun_c(a);return 0; }
#include include define LONGTH 10/定义字符串最大长度 void main() { char a[LONGTH],b[LONGTH],c[LONGTH];char*max;printf(\"请输入三个字符串,以空格隔开:\");scanf(\"%s%s%s\",a,b,c);printf(
#includeint?main(void){????int?a;????printf("请输入一个三位的整数:");????scanf("%3d",?&a);????if((a%3?==?0)&&(a/100?==?3?||?a%100/10?==?3?||?a%100%10?==?3))????????printf("yes\n");????else????????printf("not\n");????return?0;}
#include main() { double a,b,c,m;printf(\"请分2113别输入5261abc:\\n\");scanf(\"%a%b%c\",&a,&b,&c);if(a>=b&a>=c)m=a;else if(b>=c&b>=a)m=b;else m=c;printf(\"%f,%f,%f中最大的4102数是1653%m\",
#include int main(){ int a,b,c;//定义三2113个整形变量用来存储那从键盘输出5261的三个数 printf("请输入3个数&#xff1a;");//提示4102语 scanf("%d %d %d",&a,&b,&c);//从键盘输出三个数到a,b,c中 int max; //下面是最简单的if循环求1653出这三个数最大值存入max中 if(a>b) { if(a>c) { max&#61;a; } else { max&#61;c; } } else { if(b>c) { max&#61;b; } else { max&#61;c; } } printf("这三个数的最大数为: %d\n",max); return 0;}&#xff0c;有很多方法,初学2113的话不必用数组,用三个5261变量比较清晰:#includeint main(){ int a,b,c; printf("输入第一个4102数:"); scanf("%d",&a); printf("输入第二个数:"); scanf("%d",&b); printf("输入第三个1653数:"); scanf("%d",&c); if(aint main() { int a, b, c; int max; printf("请输入三个数5261&#xff1a;"); scanf("%d,%d,%d", &a, &b,&c);//从键盘获取4102三个数 max&#61; a>b ? a : b; //如a>b为真&#xff0c;1653max&#61;a,否则max&#61;b max&#61; max>c ? max : c; //如max>c 为真&#xff0c;max&#61;max&#xff0c;否则max&#61;c; printf("%d\n", max);}&#xff0c;#include void main(){ int i,j,k,m; printf("请输入2113三个想要5261比较的数&#xff1a;")&#xff1b; scanf("%d%d%d",&i,&j,&k); if(i>&#61;j&&i>&#61;k) m&#61;i; else if(k>&#61;j&&i<&#61;k) m&#61;k; else if(j>&#61;i&&j>&#61;k) m&#61;j; printf("\n这个4102最大数是1653&#xff1a;%d\n",m); }&#xff0c;#include int main(){ int max,num[3],i; for(i&#61;0;i<3;i&#43;&#43;){ scanf("%d",&num[i]);输入整数2113 } max &#61; num[0] > num[1] ? num[0]: num[1]; max &#61; max > num[2] ? max: num[2];//问号5261表达式4102&#xff0c;大值赋给1653max printf("%d\n",max); return 0;}本回答被网友采纳内容来自www.mh456.com请勿采集。