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