当前位置:网站首页>第二章编程练习
第二章编程练习
2020-11-08 16:17:00 【树大数媒201王婧】
第二章编程练习 1.打印姓名
#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.打印姓名地址
#define NAME"Halsey"
#define ADDRESS"Washington,New Jersey,USA"
int main(void)
{
printf("%s\n",NAME);
printf("%s\n",ADDRESS);
return 0;
}```
3.年龄和天数
```#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.输出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.输出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.计算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;
}```
版权声明
本文为[树大数媒201王婧]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4774086/blog/4708234
边栏推荐
- Recurrence of Apache kylin Remote Code Execution Vulnerability (cve-2020-1956)
- Eight ways to optimize if else code
- How to solve the difference between NAT IP and port IP
- Build simple business monitoring Kanban based on Alibaba cloud log service
- Golang ICMP Protocol detects viable hosts
- 我们做了一个医疗版MNIST数据集,发现常见AutoML算法没那么好用
- Returning to the third place in the world, what did Xiaomi do right?
- Xiaoqingtai officially set foot on the third day of no return
- API生命周期的5个阶段
- 一分钟全面看懂forsage智能合约全球共享以太坊矩阵计划
猜你喜欢

Development of uni app imitating wechat app

2020-11-05

机械硬盘随机IO慢的超乎你的想象

Rabbitmq (1) - basic introduction

Build simple business monitoring Kanban based on Alibaba cloud log service

Tencent, which is good at to C, how to take advantage of Tencent's cloud market share in these industries?

Leancloud changes in October

Improvement of rate limit for laravel8 update

Do these mistakes in your resume affect your annual salary of one million?

金融领域首个开源中文BERT预训练模型,熵简科技推出FinBERT 1.0
随机推荐
金融领域首个开源中文BERT预训练模型,熵简科技推出FinBERT 1.0
阿里云加速增长,进一步巩固领先优势
别再在finally里面释放资源了,解锁个新姿势!
二叉树的四种遍历方应用
我用 Python 找出了删除我微信的所有人并将他们自动化删除了
Chapter 5 programming
How does the system response time and throughput change with the increase of concurrency pressure during performance pressure testing
小青台正式踏上不归路的第3天
LeanCloud 十月变化
What are the necessary laws and regulations to know when entering the Internet?
腾讯:阿里的大中台虽好,但也不是万能的!
Recurrence of Apache kylin Remote Code Execution Vulnerability (cve-2020-1956)
Huawei has an absolute advantage in the 5g mobile phone market, and the market share of Xiaomi is divided by the market survey organization
阿里云视频云技术专家 LVS 演讲全文:《“云端一体”的智能媒体生产制作演进之路》
AI weekly: employees are allowed to voluntarily reduce salary; company response: employees are happy and satisfied; tiger tooth HR takes employees out of the company; Sweden forbids Huawei ZTE 5g equi
Workers, workers soul, draw lifelong members, become a person!
2020-11-05
10 common software architecture patterns
Gopherchina 2020 Conference
It's just right. It's the ideal state