简单小程序敲着练手额~
来源:互联网 发布:java编辑工具 编辑:程序博客网 时间:2024/05/18 20:06
2.1
#include<stdio.h>
int main(void)
{
int q;
q = 1;
printf("%d is neat.\n",q);
return 0;
}
2.2
#include <stdio.h>
int main(void)
{
int four;
four = 4;
printf("%d\n",four);
return 0;
}
2.3
#include<stdio.h>
int main(void)
{
int feet,fathoms;
fathoms=2;
feet=6*fathoms;
printf("There are %d feet in %d fathoms!\n",feet, fathoms);
return 0;
}
2.4
// fathm_ft.c --把2英寻转换成英尺
#include<stdio.h>
int main(void)
{
int feet,fathoms;
fatnoms=2;
feet=6*fathoms;
printf("There are %d feet in %d fathoms!\n",feet, fathoms);
printf("Yes, I said %d feet!\n",9*fathoms);
return 0;
}
2.5
/* two_func.c --一个文件中包含两个函数 */
#include<stdio.h>
void butler(void);/* ANSI/ISO C函数原型*/
int main(void)
{
printf("I will summon the butler function.\n");
butler();
printf("Yes.Bring me some tea and writeable DVDs.\n");
return 0;
}
void butler(void)/*函数定义开始*/
{
printf("You rang ,sir?\n");
}
2.6
#include<stdio.h>
int main(void)
{
int n ,n2 ,n3;
n=5;
n2=n*n;
n3=n2*n2;
printf("n = %d,n squared = %d, n cubed = %d\n",n, n2, n3);
return 0;
}
代码需要多敲,注意规范,要避免很二的错误,比如:中文输入法下敲出括号。。。。
- 简单小程序敲着练手额~
- java练手小程序
- 小程序练手(c++)
- 字符串的小程序练手
- 程序猿练手小项目
- 练手小程序(一)
- 练手小程序(二)
- 练手小程序(三)
- 练手小程序(四)
- 练手小程序(五)
- 练手小项目:BBS的简单开发
- 关于android的socket练手小程序
- 给个java练手小程序
- 练手小程序2 学生信息管理系统
- Qt:练手的小程序,分享出来
- java程序连接数据库小练手
- 100个python练手小程序
- c++11 文本查询练手小程序
- Hibernate 的七种映射关系
- 删除链表中间节点
- 键盘录入两个文件路径,将其中一个文件夹中的所有的文件复制到另一个文件中
- JAVASE第2天笔记
- Lesson 11: 绘制三角形
- 简单小程序敲着练手额~
- JAVASE第3天笔记
- JAVASE第4天笔记
- JAVASE第5天笔记
- 动态规划总结
- JAVASE第6天笔记
- install salt & initial configuration(centos7)
- Vollery网络框架的源码分析
- ExtJS框架 使用树控件TreeNode \ TreeLoader