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

边栏推荐
猜你喜欢

LDO voltage stabilizing chip - internal block diagram and selection parameters

RE1 attack and defense world reverse

UE4_ Ue5 combined with Logitech handle (F710) use record

Unity3d Learning Notes 6 - GPU instantiation (1)

Mysql索引优化实战一

How to change the formula picture in the paper directly into the formula in word

Anxin vb01 offline voice module access intelligent curtain guidance

Description of longitude and latitude PLT file format

LM12丨Rolling Heikin Ashi二重K线滤波器

Vulnerability recurrence ----- 49. Apache airflow authentication bypass (cve-2020-17526)
随机推荐
给出一个数组,如 [7864, 284, 347, 7732, 8498],现在需要将数组中的数字拼接起来,返回「最大的可能拼出的数字」
Open source hardware small project: anxinco esp-c3f control ws2812
0-1背包问题
v-for遍历对象
windows设置redis开启自动启动
Lm12 rolling heikin Ashi double K-line filter
Have all the fresh students of 2022 found jobs? Is it OK to be we media?
Windows set redis to start automatically
Solution of intelligent supply chain collaboration platform in electronic equipment industry: solve inefficiency and enable digital upgrading of industry
Coreseek: the second step is index building and testing
Summary of SQL single table query 2020.7.27
B_ QuRT_ User_ Guide(37)
HDU 4747 Mex「建议收藏」
Entity层、DAO层、Service层、Controller层 先后顺序
2022注册测绘师备考开始 还在不知所措?手把手教你怎么考?
Unity3d learning notes 5 - create sub mesh
Illegal behavior analysis 1
Archlinux install MySQL
伸展树(一) - 图文解析与C语言实现
SRM supplier cloud collaborative management platform solution for building materials industry to realize business application scalability and configuration