直接看代码,代码就是笔记
#include<stdio.h>
int main()
{
//初始化a和b
double a=0;
double b=0;
printf("please input two float numbers and use space cut off them:");//输出please input two float numbers and use space cut off them:
scanf("%lf %lf",&a,&b);//double类型,scanf()用 %lf
printf("%f + %f = %f",a,b,a+b);//double类型,printf()用 %f
return 0;
}
/*
课堂笔记
1. double类型,用于小数/浮点数/双数,printf用 %f,scanf用 %lf
2. int类型,用于整数,printf用 %d,scanf用 %d
*/