当前位置:网站首页>第二章编程练习
第二章编程练习
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
边栏推荐
- RestfulApi 学习笔记——父子资源(四)
- 三、函数的参数
- Stm32uberide download and install - GPIO basic configuration operation - debug (based on CMSIS DAP debug)
- write文件一个字节后何时发起写磁盘IO
- Dev-c++在windows环境下无法debug(调试)的解决方案
- Flink from introduction to Zhenxiang (10. Sink data output elasticsearch)
- Arduino IDE搭建ESP8266开发环境,文件下载过慢解决方法 | ESP-01制作WiFi开关教程,改造宿舍灯
- (O)ServiceManager分析(一)之BinderInternal.getContextObject
- 技术总监7年总结,如何进行正确的沟通?
- 这几个C++的坑,一旦踩中了,加班是肯定避免不了了!
猜你喜欢

Tips and skills of CSP examination

What is the database paradigm

“他,程序猿,35岁,被劝退”:不要只懂代码,会说话,胜过10倍默默努力

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

重返全球第三,小米做对了什么?

Build simple business monitoring Kanban based on Alibaba cloud log service

uni-app实战仿微信app开发

rabbitmq(一)-基础入门

2035我们将建成这样的国家

Learn to record and analyze
随机推荐
write文件一个字节后何时发起写磁盘IO
jsliang 求职系列 - 07 - Promise
Talk about go code coverage technology and best practices
SQL 速查
进入互联网得知道的必备法律法规有哪些?
阿里云加速增长,进一步巩固领先优势
重返全球第三,小米做对了什么?
10 common software architecture patterns
[Python 1-6] Python tutorial 1 -- number
Millet and oppo continue to soar in the European market, and Xiaomi is even closer to apple
Builder pattern
On the concurrency of update operation
我用 Python 找出了删除我微信的所有人并将他们自动化删除了
wanxin finance
喝汽水,1瓶汽水1元,2个空瓶可以换一瓶汽水,给20元,可以多少汽水
苏州游记
性能压测时,并发压力增加,系统响应时间和吞吐量如何变化
Xiaoqingtai officially set foot on the third day of no return
Mac环境安装Composer
(O)ServiceManager分析(一)之BinderInternal.getContextObject