当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- LiteOS-消息队列
- 这几个C++的坑,一旦踩中了,加班是肯定避免不了了!
- Mac环境安装Composer
- Rabbitmq (1) - basic introduction
- 2035我们将建成这样的国家
- Tencent: Although Ali's Taichung is good, it is not omnipotent!
- 区块链周报:数字货币发展写入十四五规划;拜登邀请MIT数字货币计划高级顾问加入总统过渡团队;委内瑞拉推出国营加密交易所
- Development of uni app imitating wechat app
- 技术总监7年总结,如何进行正确的沟通?
- Using k3s to create local development cluster
猜你喜欢

laravel8更新之速率限制改进

10个常见的软件架构模式

2020-11-05

Station B STM32 video learning

函数分类大pk!sigmoid和softmax,到底分别怎么用?

构建者模式(Builder pattern)

The first open source Chinese Bert pre training model in the financial field

关于adb连接手机offline的问题解决

Awk implements SQL like join operation

One minute comprehensive understanding of forsage smart contract global shared Ethereum matrix plan
随机推荐
The network adapter could not establish the connection
3、 The parameters of the function
LiteOS-消息队列-实战
Is there no way out for older programmers?
模板引擎的整理归纳
Talking about, check the history of which famous computer viruses, 80% of the people do not know!
I used Python to find out all the people who deleted my wechat and deleted them automatically
Jsliang job series - 07 - promise
搭载固态硬盘的服务器究竟比机械硬盘快多少
框架-SPI四种模式+通用设备驱动实现-源码
Leancloud changes in October
二叉树的四种遍历方应用
WebGL 水波及焦散(刻蚀)的渲染总结
进入互联网得知道的必备法律法规有哪些?
Interpretation of deepmind's latest paper: the causal reasoning algorithm in discrete probability tree is proposed for the first time
Application of four ergodic square of binary tree
.NET 大数据量并发解决方案
Travel notes of Suzhou
别再在finally里面释放资源了,解锁个新姿势!
Learn to record and analyze