当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Summary of rendering of water wave and caustics (etching) in webgl
- wanxin finance
- 我们做了一个医疗版MNIST数据集,发现常见AutoML算法没那么好用
- Flink的sink实战之一:初探
- Restfulapi learning notes -- father son resources (4)
- Golang ICMP Protocol detects viable hosts
- 漫画:寻找股票买入卖出的最佳时机(整合版)
- 关于update操作并发问题
- Xiaoqingtai officially set foot on the third day of no return
- 我用 Python 找出了删除我微信的所有人并将他们自动化删除了
猜你喜欢

Learn to record and analyze

I used Python to find out all the people who deleted my wechat and deleted them automatically

LiteOS-消息队列

C++的那些事儿:从电饭煲到火箭,C++无处不在

我用 Python 找出了删除我微信的所有人并将他们自动化删除了

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

AI香水来了,你会买吗?

Apache Kylin远程代码执行漏洞复现(CVE-2020-1956)

PHP生成唯一字符串

DeepMind 最新论文解读:首次提出离散概率树中的因果推理算法
随机推荐
DeepMind 最新论文解读:首次提出离散概率树中的因果推理算法
Hello world of rabbitmq
非常规聚合问题举例
. net large data concurrency solution
Don't release resources in finally, unlock a new pose!
markdown使用
CSP考试须知与各种小技巧
awk实现类sql的join操作
2020-11-05
聊聊Go代码覆盖率技术与最佳实践
vim-配置教程+源码
Improvement of rate limit for laravel8 update
基于阿里云日志服务快速打造简版业务监控看板
Recurrence of Apache kylin Remote Code Execution Vulnerability (cve-2020-1956)
jsliang 求职系列 - 07 - Promise
python开发qt程序读取图片的简单流程
Chapter 5 programming
Xiaoqingtai officially set foot on the third day of no return
C++的那些事儿:从电饭煲到火箭,C++无处不在
Gopherchina 2020 Conference