- 7
- 0
- 约7.44千字
- 约 16页
- 2017-06-05 发布于河南
- 举报
scanf(格式控制,输入项表)(国外英文资料)
scanf(格式控制,输入项表)
Scanf (format control, input table); Ampers-address operator
Printf (format control, output table);
- format character (output) :
Its going to be an int
Float - - - % f
Double - - % f or % lf
Char - - - - % c
String % s
Its a good thing
- format character (input) :
Its an int
Its long
Its a short one
Float
% lf or % le - double
% s -- -strings
The programming structure - the sequence structure
Rounding off the middle variable 3
- -
Conditional control statements:
- - select control statement if or if - else switch
-loop control statement
-turn to the control statement
- selection structure:
* * * if or if - else is a single-branch choice structure
The multi-branch choice structure of the * * * swtich statement
Part 1: the single-branch choice structure of the if statement
No elses if statement
The general invocation of the if statement:
If (expression) statement
For example, if (a! = b) {t = a; A = b; B = t; }
* * if is a key word
The expression is just a valid C expression.
There is only one sentence in theory, and multiple is a compound statement.
-if statement execution:
First calculate the value of the if post expression, and if the expression has a non-zero value, then execute the following clause. If its false, it doesnt.
The simple application of the if statement:
For example 1: write a function that inputs two different integers a, and b outputs the larger number of them.
# include stdio, h
Void main ()
{int a, b;
Printf ( please enter variable a, b: );
Scanf (% d % d, a, b);
If (a b) printf ( a = % d \ n );
If (b a) printf ( b = % d \ n , b);
}
Minus , a is equal to 5, and b is equal to 6
For example 2: write a function to determine whether k is odd or even.
# include stdio, h
Void main ()
{int k;
Printf ( please enter the value of the variable k: );
Scanf ( % d , k);
If (k % 2 = = 0) printf ( % d is even! \ n , k);
If (k % 2! = 0) printf ( % d is odd! \ n , k);
}
For example 3: write the program, output a, b, the largest number i
您可能关注的文档
- 40条最易搞错的生活常识(国外英文资料).doc
- 7月2日 缺少层次的潜熟悉(国外英文资料).doc
- 8.语病剖析(国外英文资料).doc
- 802.1系列协定(国外英文资料).doc
- 51CTO下载-路由汇总及算法(国外英文资料).doc
- 8031和8051,8751单片机的差别和特色(国外英文资料).doc
- 921曹刿论战(国外英文资料).doc
- 8700应用设置(国外英文资料).doc
- 995-临时聘-东胜区小学教师招聘考试音体美专业技能测试方案(国外英文资料).doc
- access的通配符(国外英文资料).doc
- 地理信息系统在高中地理教学中的空间分析能力培养策略论文.docx
- 高中物理探究:天文望远镜观测暗物质与暗能量研究论文.docx
- 高中政治课堂教学中的问题解决能力培养研究论文.docx
- 英语写作教学中学生创造性思维培养研究论文.docx
- 初中语文教学中3D打印技术在文本内容可视化中的应用研究论文.docx
- 小学语文革命题材课文教学中的情感体验与价值引导策略论文.docx
- 高中历史:XX地区河道镉污染与水蚤运动活性变迁的历史研究论文.docx
- 城市公共空间规划与城市社区公共资源优化配置的探讨论文.docx
- 小学课堂注意力培养与教师教学评价体系构建研究论文.docx
- 高中历史教学中家国情怀培育与学生价值观塑造的关系研究论文.docx
最近下载
- 《汉书·高惠高后文功臣表》完整版原文全文.pdf VIP
- TCSAE《车路协同路侧基础设施 第3部分:RSU技术要求及测试方法》编制说明.pdf VIP
- (新版)普速铁路工务安全规则.pdf VIP
- 2025年苏州健雄职业技术学院单招职业适应性测试题库及答案一套.docx VIP
- 2026年银行操作风险管理信息系统建设报告.docx
- 联合资信 -2025年债券市场发展报告.pdf VIP
- 帝奥电梯扶梯DIAO K300扶梯控制器使用说明书电气原理图纸.pdf
- 颅内压动力学的动物实验和仿真的分析研究.pdf VIP
- 2025年少先队辅导员技能大赛笔试考试测试题及参考答案.docx VIP
- 急性早幼粒细胞白血病.ppt VIP
原创力文档

文档评论(0)