当前位置:网站首页>C语言:逻辑运算和判断选择结构例题
C语言:逻辑运算和判断选择结构例题
2022-07-02 03:43:00 【念迟鱼学编程】

#include <stdio.h>
int main()
{
int x , m , n;
int sum = 0;
printf("请输入一个数(1-10000)");
scanf("%d",&x);
switch(x%2){
case 0:{
printf("请输入两个整数:");
scanf("%d%d",&m,&n);
sum = m+n;
printf("%d和%d的和为:%d\n",m,n,sum);
break;
}
default:{
printf("请输入两个整数:");
scanf("%d%d",&m,&n);
sum = m-n;
printf("%d和%d的和为:%d\n",m,n,sum);
break;
}
}
return 0;
}
边栏推荐
- Lost a few hairs, and finally learned - graph traversal -dfs and BFS
- [personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
- Jetpack之LiveData扩展MediatorLiveData
- How to do medium and long-term stocks, and what are the medium and long-term stock trading skills?
- 蓝桥杯单片机省赛第五届
- SQL Yiwen get window function
- The fourth provincial competition of Bluebridge cup single chip microcomputer
- Suggestions on settlement solution of u standard contract position explosion
- [ibdfe] matlab simulation of frequency domain equalization based on ibdfe
- 毕设-基于SSM电影院购票系统
猜你喜欢

《MATLAB 神经网络43个案例分析》:第42章 并行运算与神经网络——基于CPU/GPU的并行神经网络运算

Getting started with MQ

NLog use

【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真

Get started with Aurora 8b/10b IP core in one day (5) -- learn from the official routine of framing interface

Fourier series

The 8th Blue Bridge Cup single chip microcomputer provincial competition

Failed to upgrade schema, error: “file does not exist

Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions
![[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network](/img/11/4a8b52603e6e14a1ed6da1264dee57.png)
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
随机推荐
Yan Rong looks at how to formulate a multi cloud strategy in the era of hybrid cloud
[tips] use Matlab GUI to read files in dialog mode
Basic syntax of unity script (7) - member variables and instantiation
0基础如何学习自动化测试?按照这7步一步一步来学习就成功了
The 9th Blue Bridge Cup single chip microcomputer provincial competition
VS2010插件NuGet
"Analysis of 43 cases of MATLAB neural network": Chapter 42 parallel operation and neural network - parallel neural network operation based on cpu/gpu
【小技巧】使用matlab GUI以对话框模式读取文件
傅里叶级数
Unity脚本的基础语法(8)-协同程序与销毁方法
《MATLAB 神经网络43个案例分析》:第42章 并行运算与神经网络——基于CPU/GPU的并行神经网络运算
Jetpack's livedata extension mediatorlivedata
数据库文件逻辑结构形式指的是什么
集成底座方案演示说明
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
Fourier series
The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
Kubernetes cluster storageclass persistent storage resource core concept and use
Knowing things by learning | self supervised learning helps improve the effect of content risk control
Getting started with MQ