C primer plus:[13]
1、打开C编译器,配置环境。具体百度科也有。
2、新建 一个空白文件,保存为*.c程序。
提出的问题,在空白处建入解决的代码:
1个水分子的质量约为3.0×10^-23g,l夸脱水大约有950g。编写一个程序,要求输入水的夸脱数,
然后显示这么多水中包含多少个水分子。
3、#include<stdio.h>
int main(void)
{
float a;
printf("Please input how much quarts the water is:");
scanf("%f",&a);
printf("%f quarts water has %e molecules.\n",a,a*950/3E-23);
return(0);
}
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:185
阅读量:163
阅读量:49
阅读量:48
阅读量:97