当前位置:网站首页>Operation 2020.11.7-8
Operation 2020.11.7-8
2020-11-09 00:28:00 【TT sleepless La】
《 The first 2 Chapter 1-8 topic 》
1. Write a program , Call once printf( function , Print your first and last names on one line . Call again printf( function , Print your first name and last name on two lines . then , Call twice more printf( function , Print your first and last names on one line . The output should be as follows ( Of course, change the content of the example to your name ):
#include<stdio.h>
#include<stdlib.h>
#define NAME"tiantian"
#define SURNAME"sun"
int main(void)
{
printf("%s %s\n",NAME,SURNAME);
printf("%s\n%s\n",NAME,SURNAME);
printf("%s",NAME);
printf("%s\n",SURNAME);
system("pause");
return 0;
}

2. Write a program , Print your name and address
#include<stdio.h>
#include<stdlib.h>
#define NAME"suntiantian"
#define ADDRESS"NO.67 qianshuiwan,Taizhou"
int main(void)
{
printf("%s\n",NAME);
printf("%s\n",ADDRESS);
system("pause");
return 0;
}

3. Write a program , Convert your age to days , And show age and days , There's no need to think about leap years .
#include<stdio.h>
#include<stdlib.h>
#define DAYS_PER_YEAR 365
int main(void)
{
int age,days;
age = 19;
days=age*DAYS_PER_YEAR;
printf("You age is %d,and It is %d days.\n",age,days);
system("pause");
return 0;
}

4,4. Write a program , Generate the following output
For hes a jolly good fellow!
For he 's a jolly good fellow!
For he s a jolly good fellow!
Which nobody can deny!
except mainO Out of function , The program also calls two custom functions : A group called y jolly, Used before printing 3 strip
news , Call to print one at a time ; Another function is called deny, Print the last message
#include<stdio.h>
#include<stdlib.h>
int jolly(void);
int deny(void);
int main(void){
jolly();
jolly();
jolly();
deny();
system("pause");
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;
}

5.5. Write a program , Generate the following output .
Brazil, Russia, India, China
India, China,
Brazil, Russia
except main Out of function , The program also calls two custom functions : A group called br(), Call print once
”Brazil, Russia“;
The other one is called ic(), Call print once "india,China”. Other functions are in mainO function
To realize .

6. Write a program , Create an integer variable toes, And will toes Set to 10, The program also calculates toes Double and toes The square of . The program should print 3 It's worth , And describe them separately to show the difference .
#include<stdio.h>
#include<stdlib.h>
int main(void){
int toes;
toes-10;
printf("The Variable toes = %d.\n",toes);
printf("double toes = %d.\n",2*toes);
printf("toes' square = %d.\n",toes*toes);
system("pause");
return 0;
}

版权声明
本文为[TT sleepless La]所创,转载请带上原文链接,感谢
边栏推荐
- Have you ever thought about why the transaction and refund have to be split into different tables
- 平台商业化能力的另一种表现形式SAAS
- Huawei HCIA notes
- 14. Introduction to kubenetes
- Decorator (2)
- AQS 都看完了,Condition 原理可不能少!
- 如何通过Sidecar自定义资源减少Istio代理资源消耗
- 接口测试工具Eolinker进行post请求
- 非阻塞的无界线程安全队列 —— ConcurrentLinkedQueue
- 你有没有想过为什么交易和退款要拆开不同的表
猜你喜欢

centos7下安装iperf时出现 make: *** No targets specified and no makefile found. Stop.的解决方案

Mobile big data own website precise marketing and accurate customer acquisition

API生命周期的5个阶段

android开发中提示:requires permission android.permission write_settings解决方法

14.Kubenetes简介

Core knowledge of C + + 11-17 template (2) -- class template

分库分表的几种常见玩法及如何解决跨库查询等问题

B. protocal has 7000eth assets in one week!

Installation record of SAP s / 4hana 2020

数据库设计:范式与反范式
随机推荐
Aprelu: cross border application, adaptive relu | IEEE tie 2020 for machine fault detection
LeetCode-15:三数之和
Mobile big data own website precise marketing and accurate customer acquisition
国内三大云数据库测试对比
SQL语句的执行
Several common playing methods of sub database and sub table and how to solve the problem of cross database query
AI人工智能编程培训学什么课程?
Introduction to nmon
The vowels in the inverted string of leetcode
几行代码轻松实现跨系统传递 traceId,再也不用担心对不上日志了!
【200人面试经验】,程序员面试,常见面试题解析
文件拷贝的实现
程序员都应该知道的URI,一文帮你全面了解
Pipedrive如何在每天部署50+次的情况下支持质量发布?
Using containers to store table data
APP 莫名崩溃,开始以为是 Header 中 name 大小写的锅,最后发现原来是容器的错!
使用递增计数器的线程同步工具 —— 信号量,它的原理是什么样子的?
The vowels in the inverted string of leetcode
Share API on the web
The interface testing tool eolinker makes post request