当前位置:网站首页>C language learning log 10.10
C language learning log 10.10
2022-06-13 04:57:00 【Today is also a day without baldness】
One .Switch-case
Format :
switch( Control statement ){
case Constant :
sentence
...
case Constant :
sentence
...
default:
sentence
...
}Control expressions can only be integer results , Constants can be constants , It can also be an expression for constant calculation .
switch Statement can be regarded as a calculation based jump , After calculating the value of the control expression , The program will jump to the matching case( Branch label ) It's about . The branch label just indicates swich Road signs at internal locations , After executing the last statement in the branch , If not at the back break, It will be executed in sequence to the following case Go inside , Until I met a break, perhaps switch End .
Two . Test for weight gain
#include<stdio.h>
int main(void)
{
int H,x;
double W;
scanf("%d",&x);
if(x>100&&x<=300){
H=x;
}
W=(H-100)*0.9*2;
printf("%.1f",W);
}3、 ... and . Calculate the average and sum
#include<stdio.h>
int main(void)
{
int a,b,c,d,Sum;
double Average;
scanf("%d %d %d %d",&a,&b,&c,&d);
Sum=a+b+c+d;
Average=(a+b+c+d)/4.0;
printf("Sum = %d; Average = %.1f",Sum,Average);
}边栏推荐
- 无限循环滚动代码阿里巴巴国际站店铺装修代码底图滚动黑色半透明显示效果自定义内容装修代码全屏显示
- What is the difference between ROM, ram and flash? SRAM、DRAM、PROM、EPROM、EEPROM
- Reductive elimination
- Infinite cycle scrolling code Alibaba international station store decoration code base map scrolling black translucent display effect custom content decoration code full screen display
- Recommended temporary online image compression tool
- Advanced C language - Section 1 - data storage
- Win8.1和Win10各自的优势
- Clause 31: avoid default capture mode
- Shell variable learning notes
- What is the saturate operation in opencv
猜你喜欢

Analysis on the similarities and differences of MVC, MVP and mvvc

Article 29: assuming that the mobile operation does not exist, is expensive, and is not used

Chapter 15 mechanism: Address Translation

Kaggle 时间序列教程

Design system based on MVC using javeswingjdbc

Logical point

Embedded hardware - read schematic

Converting MySQL data to PostgreSQL with Navicat

Spread your wings and soar

自动评教脚本使用的配置
随机推荐
Handwritten promise and its method, with detailed notes
Createanonymousthreadx passes parameters to anonymous threads
C disk lossless move file
约瑟夫问题
Force deduction 121 questions
Advanced C - Section 3 - character functions and string functions
Kaggle time series tutorial
Chapter 17 free space management
The differences between the four startup modes of activity and the applicable scenarios and the setting methods of the two startup modes
Section 3 - functions
Chapter 13 abstraction: address space
Flutter dart variables and constants
QT signal is automatically associated with the slot
About mission planning and improving execution
Vercel uses HTTP caching
2022年建筑架子工(建筑特殊工种)特种作业证考试题库及在线模拟考试
Mind mapping series - Database
利用Javeswingjdbc基於mvc設計系統
Advanced C language - Section 1 - data storage
Elliptic curve encryption