prss.net
当前位置:首页 >> 求C语言编程,要求输入任意三个数,按从小到大的顺... >>

求C语言编程,要求输入任意三个数,按从小到大的顺...

int main(void) { float a, b, c, t; printf("输入任意三个数:"); scanf_s("%f,%f,%f", &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("%5.2f,%5.2f,%5....

代码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; ...

#include void main() { int a[5]; int i,j,t; printf("请输入5个数:"); for(i=0;i

#include int main() { int i,j,m; double temp; double a[3]; for(m=0;m

注意本程序中scanf的输入格式,输入整数时,记得按格式,别忘记“,”,呵呵 #include void main() { int a, b, c, d, tem; printf("input four numbers:\n"); scanf("%d,%d,%d,%d",&a,&b,&c,&d); if(a>b) {tem=a;a=b;b=tem;} if(a>c) {tem=a;a=c;...

第四行的%d改为%f 第12行的也是

#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;}

void where(int x,int y) { if(x>0) { if(y>0) printf("这个点在第一象限\n"); else if(y

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...

(1)中for(i=0;i

网站首页 | 网站地图
All rights reserved Powered by www.prss.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com