1、完整版完整版ppt12023-1-302/51完整版完整版pptHIT-C Programming 2023-1-303/51完整版完整版pptHIT-C Programming 2023-1-304/51完整版完整版pptHIT-C Programming Example:2023-1-305/51完整版完整版pptHIT-C Programming 2023-1-306/51完整版完整版pptHIT-C Programming Example:浮点数除法浮点数除法(Floating Division)or or both are floats整数除法整数除法(Integer Divisio
2、n)and are integers2023-1-307/51完整版完整版pptHIT-C Programming Example:2023-1-308/51完整版完整版pptHIT-C Programming Example:2023-1-309/51完整版完整版pptHIT-C Programming 2023-1-3010/51完整版完整版pptHIT-C Programming Example:1152101remainderresult2023-1-3011/51完整版完整版pptHIT-C Programming Example:-115-2-10-1remainderresult
3、2023-1-3012/51完整版完整版pptHIT-C Programming Example:11-5-210 1remainderresult2023-1-3013/51完整版完整版pptHIT-C Programming Example:2023-1-3014/51完整版完整版pptHIT-C Programming 2023-1-3015/51完整版完整版pptHIT-C Programming 2023-1-3016/51完整版完整版pptHIT-C Programming Example:2023-1-3017/51完整版完整版pptHIT-C Programming Examp
4、le:2023-1-3018/51完整版完整版pptHIT-C Programming Example:2023-1-3019/51完整版完整版pptHIT-C Programming 2023-1-3020/51完整版完整版pptHIT-C Programming 2023-1-3021/51完整版完整版pptHIT-C Programming 关键是如何分离个位、十位、百位数字?关键是如何分离个位、十位、百位数字?2023-1-3022/51完整版完整版pptHIT-C Programming 2023-1-3023/51完整版完整版pptHIT-C Programming 2023-1-
5、3024/51完整版完整版pptHIT-C Programming 2023-1-3025/51完整版完整版pptHIT-C Programming Example:num=num+5;num1520Example:num+=5;2023-1-3026/51完整版完整版pptHIT-C Programming 执行执行 a+=a-=a*=a 后,变量后,变量a的值?的值?a+=a-=a*=a a+=a-=9 a+=0 a=02023-1-3027/51完整版完整版pptHIT-C Programming OperationExamples of expressionDescription+=n
6、um+=5;num=num+5;-=num-=5;num=num 5;*=num*=5;num=num*5;/=num/=5;num=num/5;%=num%=5;num=num%5;2023-1-3028/51完整版完整版pptHIT-C Programming 2023-1-3029/51完整版完整版pptHIT-C Programming 2023-1-3030/51完整版完整版pptHIT-C Programming Example:j=+i-2i5similar to j?462023-1-3031/51完整版完整版pptHIT-C Programming Example:j=i+-
7、2i5similar to j?362023-1-3032/51完整版完整版pptHIT-C Programming int a=3;printf(%d,-a+);a3similar to 42023-1-3033/51完整版完整版pptHIT-C Programming 2023-1-3034/51完整版完整版pptHIT-C Programming circumference=33.300854area=88.2472632023-1-3035/51完整版完整版pptHIT-C Programming Input r:5.3 circumference=33.300854 area=88.
8、247263在程序中直接使用的常数称在程序中直接使用的常数称为幻数为幻数(Magic Number)2023-1-3036/51完整版完整版pptHIT-C Programming 2023-1-3037/51完整版完整版pptHIT-C Programming 2023-1-3038/51完整版完整版pptHIT-C Programming 2023-1-3039/51完整版完整版pptHIT-C Programming#include#define PI 3.14159;#define R 5.3;main()printf(area=%fn,PI*R*R);printf(circumfer
9、ence=%fn,2*PI*R);相当于执行相当于执行#include main()printf(area=%fn,3.14159;*5.3;*5.3;);printf(circumference=%fn,2*3.14159;*5.3;);2023-1-3040/51完整版完整版pptHIT-C Programming 2023-1-3041/51完整版完整版pptHIT-C Programming doublefloatlongunsignedintchar,short低高2023-1-3042/51完整版完整版pptHIT-C Programming 2023-1-3043/51完整版完整
10、版pptHIT-C Programming 2023-1-3044/51完整版完整版pptHIT-C Programming Example:int x=10;float y;y=(float)x;x10y?10.0000002023-1-3045/51完整版完整版pptHIT-C Programming Example:int total,number;float average;average=total/number;total15number2average?7.000000两个整数运算的结果两个整数运算的结果还是整数,不是浮点数还是整数,不是浮点数2023-1-3046/51完整版完
11、整版pptHIT-C Programming Example:int total,number;float average;average=(float)total/number;total15number2average?7.5000002023-1-3047/51完整版完整版pptHIT-C Programming m/2=2(float)(m/2)=2.000000(float)m/2=2.500000m=52023-1-3048/51完整版完整版pptHIT-C Programming 2023-1-3049/51完整版完整版pptHIT-C Programming 2023-1-3050/51完整版完整版pptHIT-C Programming Input a,b,c:3,4,5 area=6.0000002023-1-3051/51完整版完整版pptHIT-C Programming 此课件下载可自行编辑修改,供参考!感谢您的支持,我们努力做得更好!
侵权处理QQ:3464097650--上传资料QQ:3464097650
【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。