![C语言代码风格_第1页](http://file3.renrendoc.com/fileroot_temp3/2022-7/4/604fa821-095e-4c02-b43d-16e7d4e4b521/604fa821-095e-4c02-b43d-16e7d4e4b5211.gif)
![C语言代码风格_第2页](http://file3.renrendoc.com/fileroot_temp3/2022-7/4/604fa821-095e-4c02-b43d-16e7d4e4b521/604fa821-095e-4c02-b43d-16e7d4e4b5212.gif)
![C语言代码风格_第3页](http://file3.renrendoc.com/fileroot_temp3/2022-7/4/604fa821-095e-4c02-b43d-16e7d4e4b521/604fa821-095e-4c02-b43d-16e7d4e4b5213.gif)
![C语言代码风格_第4页](http://file3.renrendoc.com/fileroot_temp3/2022-7/4/604fa821-095e-4c02-b43d-16e7d4e4b521/604fa821-095e-4c02-b43d-16e7d4e4b5214.gif)
![C语言代码风格_第5页](http://file3.renrendoc.com/fileroot_temp3/2022-7/4/604fa821-095e-4c02-b43d-16e7d4e4b521/604fa821-095e-4c02-b43d-16e7d4e4b5215.gif)
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、234567void void Function(intFunction(int x) x) / / program code code void void Function(intFunction(int x) x) / / program code code if (condition)if (condition) / / program code code elseelse / / program code code if (condition)if (condition) / / program code code else else / / program code code for
2、 (initialization; condition; for (initialization; condition; update)update) / / program code code for (initialization; condition; for (initialization; condition; update)update) / / program code code while (condition)while (condition) / / program code code while (condition)while (condition) / / progr
3、am code code 如果出现嵌套的,则使用缩进对齐如果出现嵌套的,则使用缩进对齐,如:,如: 8910/ 空行空行void Function1() / 空行空行void Function2() / 空行空行void Function3() / 空行空行while (condition)statement1;/ 空行空行if (condition) statement2;elsestatement3;/ 空行空行statement4; 1112void Func1(int x, int y, int z); / 良好的风格良好的风格void Func1 (int x,int y,int z
4、); / 不良的风格不良的风格printf(%d%d%d, a, b, c); / 良好的风格良好的风格printf(%d%d%d,a,b,c); / 不良的风格不良的风格if (year = 2000) / 良好的风格良好的风格if(year=2000) / 不良的风格不良的风格if (a=b) & (c=b&c=d) / 不良的风格不良的风格for (i=0; i10; i+) / 良好的风格良好的风格for(i=0;i10;i+) / 不良的风格不良的风格for (i = 0; i 10; i +) / 过多的空格过多的空格x = a b ? a : b; / 良好的风格
5、良好的风格x=aFunction(); / 不要写成不要写成 b - Function();1314intint width; width;/ / 宽度宽度intint height; height;/ / 高度高度intint depth; depth;/ / 深度深度intint width, height, depth; / width, height, depth; /宽度高度深度宽度高度深度x = a + b;x = a + b;y = c + d;y = c + d;z = e + f;z = e + f;x =x = a + b; y = c + d; z = e + f;a +
6、 b; y = c + d; z = e + f;if (width height) if (width height) dosomethingdosomething();(); if (width height) if (width height) dosomethingdosomething();();for (initialization; condition; for (initialization; condition; update)update) dosomethingdosomething();(); / / 空行空行other();other();for (initialization; condition; update)for (initialization; condition; update) dosomethingdosomething();();other();other();1516171819202122232425262728293031323334353637383940414243当只允许函数访问地址内容,不允许修改当只允许函数访问地址内容,不允许修改时,可以把函数的指针参数定义为时,可以把函数的
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 公司保安个人工作计划
- 班长个人年终工作总结
- 书香班级文化建设方案
- 电子商务行业的数据分析与智能决策
- 室内装修拆除施工合同范本
- 白水泥材料在办公家具中的创新应用
- 无人机培训安全协议书范本
- 大型活动承办合同范本
- 山西省运城市2024-2025学年高二上学期11月期中考试生物试题(解析版)
- 山东省临沂市河东区2024-2025学年高二上学期11月期中考试生物试题(解析版)
- GSV2.0处理有害生物(虫害)污染程序+安全和农业检查程序
- 《社会主义市场经济理论(第三版)》第八章社会主义市场经济调控论
- 交流伺服系统常见故障及处理分解课件
- 化工厂员工电气安全教育培训课件
- 圣三国蜀汉传攻略
- 建设项目竣工环境保护验收政策法规课件
- 2021届高考英语887核心词(打印、词频、出处、例句、背诵)
- 天津市乡镇卫生院街道社区卫生服务中心地址医疗机构名单
- 公司机关管理类责任矩阵
- 钉钉考勤休假规定
- 山东省青岛市各县区乡镇行政村村庄村名居民村民委员会明细及行政区划代码
评论
0/150
提交评论