www.1862.net > C语言编程题,从键盘输入任意3个数,按从小到大的顺...

C语言编程题,从键盘输入任意3个数,按从小到大的顺...

代码1. // 输入3个数,要求按从小到大顺序输出 #include int main() { int a,b,c,t; printf("请输入三个数:"); scanf("%d%d%d",&a,&b,&c); if(a > b) { t = a; a = b; b = t; } if(a > c) { t = a; a = c; c = t; } if(b > c) { t = b; b = c; ...

代码1. // 输入3个数,要求按从小到大顺序输出 #include int main() { int a,b,c,t; printf("请输入三个数:"); scanf("%d%d%d",&a,&b,&c); if(a > b) { t = a; a = b; b = t; } if(a > c) { t = a; a = c; c = t; } if(b > c) { t = b; b = c; ...

#includevoid main(){int a,b,c,t;printf("请输入三个整数:a b c\n");scanf("%d%d%d",&a,&b,&c);if(a>b){t=a;a=b;b=t;}if(a>c){t=a;a=c;c=t;}if(b>c){t=b;b=c;c=t;}printf("排序后的三个整数为:%d,%d,%d\n",a,b,c);}

#include int main(){ int s=0,a,b,c; scanf("%d%d%d",&a,&b,&c); if(a>b) { s=a; a=b; b=s; } if(a>c) { s=a; a=c; c=s; }if(b>c) { s=b; b=c; c=s; } printf("%d\t%d\t%d\n",a,b,c); getchar(); getchar(); return 0;}

(1)中for(i=0;i

int main(int argc, const char * argv[]) { int a[3] = {0}; printf("输入三个整数空格隔开:\n"); for (int i = 0; i < 3; i++) { scanf("%d", &a[i]); } for (int i = 0; i < 2; i++) { for (int j = 0; j < 2 - i; j++) { if (a[j] > a[j + 1...

int main() { int input; int i; int n1,n2,n3; scanf("%d",&input); for(i = 100; i

#include main() { int x,y,z,t; scanf("%d%d%d",&x,&y,&z); if (x

#include int main(void) { int i, j; int arr[10], tmp; printf("十个整数:"); for (i = 0; i < 10; i++) { scanf("%d", &arr[i]); } //输入·十个数 for (j = 1; j

#include void main() { int a,b,c,t; printf("请输入三个整数:a b c\n"); scanf("%d%d%d",&a,&b,&c); if(a>b) { t=a; a=b; b=t; } if(a>c) { t=a; a=c; c=t; } if(b>c) { t=b; b=c; c=t; } printf("排序后的三个整数为:%d,%d,%d\n",a,b,c); }...

网站地图

All rights reserved Powered by www.1862.net

copyright ©right 2010-2021。
www.1862.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com