当前位置:网站首页>第二章编程练习
第二章编程练习
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
边栏推荐
- Blockchain weekly: the development of digital currency is written into the 14th five year plan; Biden invited senior adviser of MIT digital currency program to join the presidential transition team; V
- Welcome to offer, grade P7, face-to-face sharing, 10000 words long text to take you through the interview process
- Learn to record and analyze
- Application of four ergodic square of binary tree
- 契约式设计(Dbc)以及其在C语言中的应用
- 软件开发中如何与人协作? | 每日趣闻
- 新型存算一体芯片诞生,利好人工智能应用~
- STM32CubeIDE下载安装-GPIO基本配置操作-Debug调试(基于CMSIS DAP Debug)
- 谷歌开源能翻译101种语言的AI模型,只比Facebook多一种
- Flink: from introduction to Zhenxiang (6. Flink implements UDF function - realizes more fine-grained control flow)
猜你喜欢
随机推荐
2020-11-05
Elasticsearch learning one (basic introduction)
2020-11-05
AI周报:允许“员工自愿降薪”;公司回应:员工内心高兴满意;虎牙HR将员工抬出公司;瑞典禁用华为中兴5G设备
Solution of DEV-C + + unable to debug in Windows Environment
svg究竟是什么?
构建者模式(Builder pattern)
Suitable for C / C + + novice learning some projects, do not give me to miss!
Blockchain weekly: the development of digital currency is written into the 14th five year plan; Biden invited senior adviser of MIT digital currency program to join the presidential transition team; V
Builder pattern
RabbitMQ之Helloworld
Design by contract (DBC) and its application in C language
新型存算一体芯片诞生,利好人工智能应用~
What are the necessary laws and regulations to know when entering the Internet?
Don't release resources in finally, unlock a new pose!
Arduino IDE搭建ESP8266开发环境,文件下载过慢解决方法 | ESP-01制作WiFi开关教程,改造宿舍灯
契约式设计(Dbc)以及其在C语言中的应用
markdown使用
LiteOS-消息队列
重返全球第三,小米做对了什么?