#每日一练-1#
2014-04-10 21:52
267 查看
#include <stdio.h> #if 0 //test 1 void main(void) { int input; char output1; //char output2; printf("please input ASCII symbol:"); scanf("%d",&input); output1=(char)input; //output2='input'; printf("output1=%c\n",output1); } int main(void) { int ascii; printf("Enter an ASCII code: "); scanf("%d", &ascii); printf("%d is the ASCII code for %c.\n", ascii, ascii); return 0; } #endif #if 0 //test2 int main(void) { float f_number; printf("Enter an float number: "); scanf("%f",&f_number); printf("The input is %f or %e.\n", f_number,f_number); } #endif #if 0 // test3 int main(void) { float water_kt; float water_weight; float water_molecule; printf("Enter water weight: "); scanf("%f",&water_kt); water_weight=water_kt*950; water_molecule=water_weight/3.0e-23; printf("the number of water molecule is %e\n",water_molecule); } #endif int main(void) { float mass_mol = 3.0e-23; /* mass of water molecule in grams */ float mass_qt = 950; /* mass of quart of water in grams */ float quarts; float molecules; printf("Enter the number of quarts of water: "); scanf("%f", &quarts); molecules = quarts * mass_qt / mass_mol; printf("%f quarts of water contain %e molecules.\n", quarts, molecules); return 0; }
相关文章推荐
- C++学习之智能指针--auto_ptr、scoped_ptr、scoped_array、shared_ptr、shared_array、weak_ptr
- 判断磁盘类型
- “打工女皇帝”吴士宏-永远先走一步
- 暑期实习4月份笔试试题解答-Android 工程师(3)
- 大话数据结构之第二章算法总结,重点知识,时间复杂度
- 嗯
- xcode快捷键
- 随机数的产生——————摘录
- RIB表与FIB表、ARB表与FDB表的区别
- .NET(C#):GetHashCode 的作用
- 关于tomcat启动后马上又自动关闭的问题
- centOS安装theano
- 【CDQ分治】数据
- MySQL 常见操作
- python中的迭代器与生成器
- Dialog的使用(二):AlertDialog.setItems
- 重温那些模糊的知识点 ----Session,Cookie
- win8.1 安装arcgis server10.2出现 Error 1935 错误
- Java开发的10位牛人
- 常用mysql语句总结