溢出初探
#include <stdio.h> int main() { short a, b; a= 32760; printf("a=%d\n",a); b = a + 10; printf("b=%d\n",b); return 0; }
让数学老师如何面对?
C语言及程序设计初步例程
#include <stdio.h> 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; }
0.65-0.6的结果是等于0.05吗?
#include <stdio.h> int 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; }
时间: 2024-09-27 19:41:06