当前位置:网站首页>C # exchange number, judge to pass the exam
C # exchange number, judge to pass the exam
2022-07-07 23:33:00 【Bobo in summer】
static void Swap( ref int x, ref int y)
{
int temp;
temp = x;
x = y;
y = temp;
}
int m = 2, n = 3;
Console.WriteLine(" Exchange before , Two Numbers {0} and {1}",m,n);
Swap(ref m,ref n);
Console.WriteLine(" After exchanging , Two Numbers {0} and {1}", m,n);
Console.ReadKey();
class Student
{
public string name;
int Score;
public int Score1
{
get {
return Score; }
set {
Score = value;
if (value >= 0 && value <= 100)
{
Score = value;
}
else
Score = -1;
}
}
}
Student stu = new Student();
Console.WriteLine(" Please enter your name ");
stu.name = Console.ReadLine();
Console.WriteLine(" Please enter your score ");
stu.Score1 = int.Parse(Console.ReadLine());
if (stu.Score1 == -1)
{
Console.WriteLine(" data is invalid ");
}
else
{
if (stu.Score1 >= 60 && stu.Score1 <= 100)
{
Console.WriteLine(" You have passed the exam ");
}
else if (stu.Score1 <= 60)
{
Console.WriteLine(" Failed the exam ");
}
}
Console.ReadKey();
边栏推荐
- Puce à tension stabilisée LDO - schéma de bloc interne et paramètres de sélection du modèle
- Oracle database backup and recovery
- LDO稳压芯片-内部框图及选型参数
- Description of longitude and latitude PLT file format
- 家用电器行业渠道商协同系统解决方案:助力家电企业快速实现渠道互联网化
- v-for遍历对象
- USB (XVI) 2022-04-28
- 2022 届的应届生都找到工作了吗?做自媒体可以吗?
- Ros2 topic (03): the difference between ros1 and ros2 [02]
- Cloud native is devouring everything. How should developers deal with it?
猜你喜欢
ROS2专题(03):ROS1和ROS2的区别【01】
Open source hardware small project: anxinco esp-c3f control ws2812
Summary of SQL single table query 2020.7.27
生鲜行业数字化采购管理系统:助力生鲜企业解决采购难题,全程线上化采购执行
建筑建材行业SRM供应商云协同管理平台解决方案,实现业务应用可扩展可配置
Design and implementation of spark offline development framework
LM12丨Rolling Heikin Ashi二重K线滤波器
SAP HR 劳动合同信息 0016
Unity3d learning notes 5 - create sub mesh
B_QuRT_User_Guide(36)
随机推荐
SAP HR 劳动合同信息 0016
HDU 4747 mex "recommended collection"
Mysql索引优化实战二
树后台数据存储(採用webmethod)[通俗易懂]
B_QuRT_User_Guide(38)
Illegal behavior analysis 1
【7.5】15. 三数之和
Matlab SEIR infectious disease model prediction
USB (XIV) 2022-04-12
Live server usage
Open source hardware small project: anxinco esp-c3f control ws2812
Dynamic agent explanation (July 16, 2020)
高效的S2B2C电商系统,是这样帮助电子材料企业提升应变能力的
Map operation execution process
移动端异构运算技术 - GPU OpenCL 编程(基础篇)
0-1背包问题
Add data analysis tools in Excel
sql 数据库执行问题
js 获取对象的key和value
2022注册测绘师备考开始 还在不知所措?手把手教你怎么考?