当前位置:网站首页>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();
边栏推荐
- 13、 System optimization
- IDEA 2021.3. X cracking
- Summary of SQL single table query 2020.7.27
- Sequence of entity layer, Dao layer, service layer and controller layer
- 0-1背包问题
- 云原生正在吞噬一切,开发者该如何应对?
- Mysql索引优化实战一
- LeeCode -- 6. Zigzag transformation
- B_QuRT_User_Guide(37)
- Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
猜你喜欢
SAP HR 社会工作经历 0023
ESP at installation esp8266 and esp32 versions
List. How to achieve ascending and descending sort() 2020.8.6
[STM32 + esp-12s connect Tencent cloud IOT development platform 1] creation of cloud platform and burning of at firmware
Mysql索引优化实战一
[stm32+esp8266 connect Tencent cloud IOT development platform 2] stm32+esp8266-01s connect Tencent cloud
Ros2 topic (03): the difference between ros1 and ros2 [01]
Spark 离线开发框架设计与实现
包装行业智能供应链S2B2B商城解决方案:开辟电商消费新生态
The efficient s2b2c e-commerce system helps electronic material enterprises improve their adaptability in this way
随机推荐
v-for遍历对象
LM12丨Rolling Heikin Ashi二重K线滤波器
Anxin vb01 offline voice module access intelligent curtain guidance
FPGA basics catalog
0-1背包问题
Given an array, such as [7864, 284, 347, 7732, 8498], now you need to splice the numbers in the array to return the "largest possible number."
经纬度PLT文件格式说明
HDU 4747 Mex「建议收藏」
RE1 attack and defense world reverse
Tree background data storage (using webmethod) [easy to understand]
Lm12 rolling heikin Ashi double K-line filter
Mysql索引优化实战二
SAP 内存参数调优过程
B_ QuRT_ User_ Guide(38)
Cloud native data warehouse analyticdb MySQL user manual
Dynamic agent explanation (July 16, 2020)
Summary of common methods of object class (September 14, 2020)
ESP at installation esp8266 and esp32 versions
Caip2021 preliminary VP
LDO穩壓芯片-內部框圖及選型參數