正在加载图片...
符号常量举例 ●例:计算某类食品的价格,要求从键盘读 入购买该食品的数目,输出总价格 #include <stdio. h> define PRICE 28 Main in七 printf("input number: )i canf("d" &num printf("total d", num prIce)i return o 电子科技大学通信与信息工程学院电子科技大学通信与信息工程学院 符号常量举例 ⚫ 例:计算某类食品的价格,要求从键盘读 入购买该食品的数目,输出总价格。 #include <stdio.h> #define PRICE 28 Main () { int num; printf("input number: "); scanf("%d", &num); printf("total = %d", num * PRICE); return 0; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有