正在加载图片...
例求一个数的绝对值 Include <stdio.h> mainO int x, y, printf( Enter an integer: ) scanf("od", &x); y-x, if(y<o y= -, printf(" integer: %od--->absolute value: %dn",x, y) 运行: Enter an integer:-12 integer: -12--->absolute value: 12#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 高等教育资讯网 版权所有