当前位置:网站首页>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;
}
边栏推荐
- Xlwings drawing
- 软件测试人的第一个实战项目:web端(视频教程+文档+用例库)
- 0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed
- Suggestions on settlement solution of u standard contract position explosion
- NLog使用
- 蓝桥杯单片机省赛第十二届第一场
- The 10th Blue Bridge Cup single chip microcomputer provincial competition
- The fourth provincial competition of Bluebridge cup single chip microcomputer
- Generate random numbers that obey normal distribution
- Didi open source Delta: AI developers can easily train natural language models
猜你喜欢

MySQL之账号管理

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

MD5 of Oracle

Account management of MySQL

NLog使用
![[yolo3d]: real time detection of end-to-end 3D point cloud input](/img/5e/f17960d302f663db75ad82ae0fd70f.jpg)
[yolo3d]: real time detection of end-to-end 3D point cloud input

蓝桥杯单片机第六届温度记录器

Detailed explanation of ThreadLocal
![[ibdfe] matlab simulation of frequency domain equalization based on ibdfe](/img/a1/441f400668e736b70cb36443f2267a.png)
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe
随机推荐
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
The 8th Blue Bridge Cup single chip microcomputer provincial competition
蓝桥杯单片机省赛第六届
How to establish its own NFT market platform in 2022
[punch in] flip the string (simple)
This article describes the step-by-step process of starting the NFT platform project
Exchange rate query interface
The 5th Blue Bridge Cup single chip microcomputer provincial competition
Fourier series
In the era of programmers' introspection, five-year-old programmers are afraid to go out for interviews
Kubernetes cluster storageclass persistent storage resource core concept and use
蓝桥杯单片机第六届温度记录器
一天上手Aurora 8B/10B IP核(5)----从Framing接口的官方例程学起
Unity脚本的基础语法(7)-成员变量和实例化
《MATLAB 神经网络43个案例分析》:第42章 并行运算与神经网络——基于CPU/GPU的并行神经网络运算
蓝桥杯单片机省赛第十一届
蓝桥杯单片机第四届省赛
Failed to upgrade schema, error: “file does not exist
Jetpack's livedata extension mediatorlivedata
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe