本文共 637 字,大约阅读时间需要 2 分钟。
溢出初探
#include让数学老师如何面对? C语言及程序设计初步例程int main(){ short a, b; a= 32760; printf("a=%d\n",a); b = a + 10; printf("b=%d\n",b); return 0;}
#include0.65-0.6的结果是等于0.05吗?int main(){ double a,b,c; a=1234567890.123456789; b=987654321.987654321; c=a+b; printf(" %22.9lf\n",a); printf("+ %22.9lf\n",b); printf("------------------------\n"); printf("= %22.9lf\n",c); return 0;}
#includeint main(){ double a = 0.65f; double b = 0.6f; double c = a - b; if (c==0.05) printf("对了!\n"); else printf("错了!\n"); printf("%10.8lf %10.8lf\n", a, b); return 0;}
转载地址:http://bybga.baihongyu.com/