当前位置:网站首页>Chapter 2 programming exercises
Chapter 2 programming exercises
2020-11-08 16:17:00 【Wang Jing】
Chapter 2 programming exercises 1. Print name
#define NAME"Billie"
#define SURNAME"Eilish"
int main(void)
{
printf("%s %s\n",NAME,SURNAME);
printf("%s\n %s\n",NAME,SURNAME);
printf("%s",NAME);
printf("%s\n",SURNAME);
return 0;
}
2. Print name and address
#define NAME"Halsey"
#define ADDRESS"Washington,New Jersey,USA"
int main(void)
{
printf("%s\n",NAME);
printf("%s\n",ADDRESS);
return 0;
}```
3. Age and days
```#include <stdio.h>
int main(void)
{
int age,day;
age=17;
day=17*365;
printf("my age=%d days=%d",age,day);
return 0;
}```
4. Output jolly deny
```#include <stdio.h>
int jolly(void);
int deny(void);
int main(void){
jolly();
jolly();
jolly();
deny();
return 0;
}
int jolly(void){
printf("For he's a jolly good fellow!\n");
return 0;
}
int deny(void){
printf("Which nobody can deny!\n");
return 0;/*wj*/
}```
5. Output bric
```#include <stdio.h>
int br(void);
int ic(void);
int main(void){
br();
printf(",");
ic();
printf(",\n");
br();
printf("\n");
return 0;
}
int br(void){
printf("Brazil,Russia");
return 0;
}
int ic(void)
{
printf("India,China");
return 0;//wj
}```
6. Calculation toes
```#include <stdio.h>
int main(void){
int toes;
toes=10;
printf("The Variablem toes=%d.\n",toes);
printf("donble toes=%d.\n",2*toes);
printf("toes'square=%d.\n",toes*toes);
return 0;
}```
7.smile
```int smile(void);
#include <stdio.h>
int main(void) {
smile();smile();smile();
printf("\n");
smile;smile;
printf("\n");
smile;
printf("n");
return 0;
}
int smile(void){
printf("smile!");
return 0;
}```
8.one-three
```#include <stdio.h>
int one_three(void);
int two(void);
int main(void){
printf("Starting now:\n");
one_three();
printf("Done!\n");
return 0;
}
int one_three(void){
printf("one\n");
two();
printf("three\n");
return 0;
}
int two(void){
printf("two\n");
return 0;
}```
版权声明
本文为[Wang Jing]所创,转载请带上原文链接,感谢
边栏推荐
- Five phases of API life cycle
- 学习记录并且简单分析
- TypeScript(1-2-2)
- jsliang 求职系列 - 07 - Promise
- 这几个C++的坑,一旦踩中了,加班是肯定避免不了了!
- 技术总监7年总结,如何进行正确的沟通?
- laravel8更新之速率限制改进
- 金融领域首个开源中文BERT预训练模型,熵简科技推出FinBERT 1.0
- I used Python to find out all the people who deleted my wechat and deleted them automatically
- Xiaoqingtai officially set foot on the third day of no return
猜你喜欢

The birth of a new integrated memory and computing chip is conducive to the application of artificial intelligence~

LeanCloud 十月变化

C + + things: from rice cookers to rockets, C + + is everywhere

Travel notes of Suzhou

Xiaoqingtai officially set foot on the third day of no return

别再在finally里面释放资源了,解锁个新姿势!

Summary of template engine

wanxin finance

二叉树的四种遍历方应用

wanxin finance
随机推荐
苏州游记
Mac环境安装Composer
Elasticsearch learning one (basic introduction)
The birth of a new integrated memory and computing chip is conducive to the application of artificial intelligence~
三、函数的参数
我们做了一个医疗版MNIST数据集,发现常见AutoML算法没那么好用
Leancloud changes in October
The first open source Chinese Bert pre training model in the financial field
How does Alibaba cloud's maxcompute add (original ODPs) work?
模板引擎的整理归纳
One minute comprehensive understanding of forsage smart contract global shared Ethereum matrix plan
小米、OPPO在欧洲市场继续飙涨,小米更是直逼苹果
AI周报:允许“员工自愿降薪”;公司回应:员工内心高兴满意;虎牙HR将员工抬出公司;瑞典禁用华为中兴5G设备
Station B STM32 video learning
聊聊Go代码覆盖率技术与最佳实践
别再在finally里面释放资源了,解锁个新姿势!
Flink的sink实战之一:初探
新型存算一体芯片诞生,利好人工智能应用~
awk实现类sql的join操作
B站stm32视频学习