正在加载图片...
例求一个数的绝对值 ch5 1.c*/ include <stdio. h> main Int x,y, orIn ntf( Enter an integer: scan f("%od"&x) y-X if(x<0) printf("integer: %d--->absolute value: %dnx,y) 运行: Enter an integer:-12 integer: -12--->absolute value: 12/*ch5_1.c*/ #include <stdio.h> main() { int x,y; printf("Enter an integer:"); scanf("%d",&x); y=x; if(x<0) y= -y; printf("\ninteger:%d--->absolute value:%d\n",x,y); } 例 求一个数的绝对值 运行:Enter an integer:-12 integer:-12--->absolute value :12
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有