随笔分类 -  C语言

摘要:C语言-----理论部分 一:软件开发概述1.程序语言的发展:机器语言-->汇编语言-->高级语言。2.软件开发的基本步骤与方法:分析问题,建立数学模型-->确定数据结构和算法-->编制程序-->调试程序。3.算法的基本特征:有穷性 确定性 有效性 有零个或多个输入 有一个或多个输出。4.编码实现... 阅读全文
posted @ 2014-11-08 20:04 NAYNEHC 阅读(518) 评论(0) 推荐(0) 编辑
摘要:#include#define NUM 5int main(void){ int a[NUM]; int i,j; int tmp; for(i=0;ia[j]){ tmp = a[i]; a[i]=a[j]; a[j]=tmp; } } } for(i=... 阅读全文
posted @ 2014-11-01 16:58 NAYNEHC 阅读(132) 评论(0) 推荐(0) 编辑
摘要:#include#includeint main(void){ int systemNum[4]; int userNum[4]; int i,j,c=0; /*do{ srand(time(NULL)); for(i=0;i<4;i++){ systemNum[i... 阅读全文
posted @ 2014-11-01 16:40 NAYNEHC 阅读(312) 评论(0) 推荐(0) 编辑
摘要:#include #include int main (void){ int num,answer,count=0; srand(time(NULL)); answer = rand()%100+900; while (1){ printf("请输入您的数字:\n"); scanf("%... 阅读全文
posted @ 2014-10-26 16:03 NAYNEHC 阅读(157) 评论(0) 推荐(0) 编辑
摘要:#include #include int main (void){ int password,one,two,money1=1000000,money2=999999,a=0;//a为取的金额 money1为人命币 money2 为美元 printf("请输入您的密码:\n"); scanf("... 阅读全文
posted @ 2014-10-24 00:37 NAYNEHC 阅读(734) 评论(0) 推荐(0) 编辑
摘要:将一个正整数分解质因数 #include int main(){ int n,i; printf("请输入一个数:\n"); scanf("%d",&n); printf("%d=",n); for(i=2;i<=n;i++) while(n!=i) { if(n%i=... 阅读全文
posted @ 2014-10-23 01:58 NAYNEHC 阅读(301) 评论(0) 推荐(0) 编辑
摘要:1.用最高位表示数字的正负号。 0表示正号, 1表示负号。 2.字符A用十进制数表示是65,字符a用十进制数表示是97. 3.数据类型:整型 ( 关键字 占用字节数) short 2 int 4 ... 阅读全文
posted @ 2014-10-18 13:50 NAYNEHC 阅读(384) 评论(0) 推荐(0) 编辑
摘要:程序语言的发展:机器语言 汇编语言 高级语言 软件开发的基本步骤:分析问题,建立数学模型。 确定数据结构和算法。 编制程序 。 调制程序。 算法的特性:有穷性 确定性 有零个或多个输入 有一个或多个输出 有效性 流程图:其优点是形象直观,简单易懂,便于修改和交流。 结构化程序设计:顺序结构... 阅读全文
posted @ 2014-10-18 13:45 NAYNEHC 阅读(356) 评论(0) 推荐(0) 编辑
摘要:C语言关键字auto :声明自动变量 一般不使用double :声明双精度变量或函数int: 声明整型变量或函数struct:声明结构体变量或函数break:跳出当前循环else :条件语句否定分支(与 if 连用)long :声明长整型变量或函数switch :用于开关语句case:开关语句分支e... 阅读全文
posted @ 2014-10-12 17:07 NAYNEHC 阅读(459) 评论(0) 推荐(0) 编辑
摘要:main 主要的 printf(print format)格式输出 include , return ,if ,else ,switch ,case 机箱;案例; default 默认 ,for whilebreak 暂停;间断; continue math int cha... 阅读全文
posted @ 2014-09-21 19:19 NAYNEHC 阅读(668) 评论(2) 推荐(0) 编辑

点击右上角即可分享
微信分享提示