当前位置:网站首页>第二章编程练习
第二章编程练习
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
边栏推荐
- 我用 Python 找出了删除我微信的所有人并将他们自动化删除了
- 2020-11-05
- Windows下快递投递柜、寄存柜的软件初探
- Golang ICMP协议探测存活主机
- Summary of rendering of water wave and caustics (etching) in webgl
- How to make a correct summary for 7 years?
- 谷歌开源能翻译101种语言的AI模型,只比Facebook多一种
- Talk about go code coverage technology and best practices
- It's just right. It's the ideal state
- STM32CubeIDE下载安装-GPIO基本配置操作-Debug调试(基于CMSIS DAP Debug)
猜你喜欢
On the concurrency of update operation
Huawei has an absolute advantage in the 5g mobile phone market, and the market share of Xiaomi is divided by the market survey organization
Flink: from introduction to Zhenxiang (3. Reading data from collection and file)
基于阿里云日志服务快速打造简版业务监控看板
CSP考试须知与各种小技巧
打工人,打工魂,抽终身会员,成为人上人!
(O)ServiceManager分析(一)之BinderInternal.getContextObject
write文件一个字节后何时发起写磁盘IO
三、函数的参数
Builder pattern
随机推荐
Builder pattern
LiteOS-消息队列
How to cooperate with people in software development? |Daily anecdotes
新型存算一体芯片诞生,利好人工智能应用~
Examples of unconventional aggregation
On the concurrency of update operation
Elasticsearch 学习一(基础入门).
RestfulApi 学习笔记——父子资源(四)
非常规聚合问题举例
How to solve the difference between NAT IP and port IP
苏州游记
构建者模式(Builder pattern)
[Python 1-6] Python tutorial 1 -- number
性能压测时,并发压力增加,系统响应时间和吞吐量如何变化
Talk about go code coverage technology and best practices
Leancloud changes in October
框架-SPI四种模式+通用设备驱动实现-源码
RabbitMQ之Helloworld
2020-11-05
Is there no way out for older programmers?