当前位置:网站首页>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();

边栏推荐
- Live-Server使用
- 电子设备行业智能供应链协同平台解决方案:解决低效, 赋能产业数字化升级
- 2022 Season 6 perfect children's model Shaanxi finals came to a successful conclusion
- 2022第六季完美童模陕西总决赛圆满落幕
- Explain
- 【7.5】15. 三数之和
- [stm32+esp8266 connects to Tencent cloud IOT development platform 3] stm32+esp8266-01s dynamically registers devices on Tencent cloud (at instruction mode) -- with source code
- FreeLink开源呼叫中心设计思想
- B_ QuRT_ User_ Guide(38)
- The 19th Zhejiang Provincial College Programming Contest VP record + supplementary questions
猜你喜欢

2021icpc Shanghai h.life is a game Kruskal reconstruction tree

Puce à tension stabilisée LDO - schéma de bloc interne et paramètres de sélection du modèle

三问TDM

LDO voltage stabilizing chip - internal block diagram and selection parameters

Summary of SQL single table query 2020.7.27
![[stm32+esp8266 connects to Tencent cloud IOT development platform 3] stm32+esp8266-01s dynamically registers devices on Tencent cloud (at instruction mode) -- with source code](/img/55/ab50ead2564498cb214d98ac5b9c3d.jpg)
[stm32+esp8266 connects to Tencent cloud IOT development platform 3] stm32+esp8266-01s dynamically registers devices on Tencent cloud (at instruction mode) -- with source code

ROS2专题(03):ROS1和ROS2的区别【01】

Right click the idea file to create new. There is no solution to create new servlet

Markdown
![[compilation principle] lexical analysis design and Implementation](/img/8c/a3a50e6b029c49caf0d791f7d4513a.png)
[compilation principle] lexical analysis design and Implementation
随机推荐
StringUtils工具类
MATLAB signal processing [Q & A essays · 2]
2021icpc Shanghai h.life is a game Kruskal reconstruction tree
leetcode-520. Detect capital letters -js
POJ2392 SpaceElevator [DP]
How can we make money by making video clips from our media?
[untitled]
电子设备行业智能供应链协同平台解决方案:解决低效, 赋能产业数字化升级
648. Word replacement
Turbo introder common scripts
B_ QuRT_ User_ Guide(36)
Installing spss25
云原生数据仓库AnalyticDB MySQL版用户手册
Progress broadcast | all 29 shield machines of Guangzhou Metro Line 7 have been launched
Puce à tension stabilisée LDO - schéma de bloc interne et paramètres de sélection du modèle
在软件工程领域,搞科研的这十年!
Oracle database backup and recovery
Lm12 rolling heikin Ashi double K-line filter
Mysql索引优化实战二
Tree background data storage (using webmethod) [easy to understand]