语句
2015-10-29 17:00
381 查看
Console.WriteLine("你能跑的过豹子吗?(能?不能)");
string a =Console.ReadLine();
if(a=="能")
{
Console.WriteLine("你比禽兽还禽兽");
}
else if (a == "不能")
{
Console.WriteLine("你连禽兽都不如");
}
else
{
Console.WriteLine("输入有误!");
}
Console.ReadLine();
//判断输入的内容是(能)或者(不能) 还是其他
//if() {} elseif(){} ....else{}
}Console.Write("请输入x=");
int x = int.Parse(Console.ReadLine());
Console.Write("请输入Y=");
int Y = int.Parse(Console.ReadLine());
if (x >= Y)
{
Console.WriteLine(x + " " + Y);
}
else
{
int zhong;//利用中间变量,将两个变量的值 进行互换
zhong = x;
x = Y;
Y = zhong;
Console.WriteLine(Y+""+x);
}
Console.ReadLine();
Console.Write("请输入x=");
int x = int.Parse(Console.ReadLine());
Console.Write("请输入Y=");
int Y = int.Parse(Console.ReadLine());
Console.Write("请输入z=");
int z = int.Parse(Console.ReadLine());
if (x < Y && x < z)
{
Console.WriteLine(x);
if (Y < z)
{
Console.WriteLine(Y); Console.WriteLine(z);
}
else
{
Console.WriteLine(z); Console.WriteLine(Y);
}
}
if (Y < x && Y < z)
{
{
Console.WriteLine(Y);
}
if (x < z)
{
Console.WriteLine(x); Console.WriteLine(z);
}
else
{
Console.WriteLine(z); Console.WriteLine(x);
}
}
if (z < x && z < Y)
{
{
Console.WriteLine(z);
}
if (x < Y)
{
Console.WriteLine(x); Console.WriteLine(Y);
}
else
{
Console.WriteLine(Y); Console.WriteLine(x);
}
}
Console.WriteLine("输入一个小于等于100的整数:");
int a = int.Parse(Console.ReadLine());
if (a <= 100)//先保证输入的数是小于等于100
{
if (a < 10)//先排除小于十的
{
Console.WriteLine("这是个小于10的整数");
}
else//剩下10-100
{
if (a == 100)
{
Console.WriteLine("这个数是100!");
}
else//剩下的就是10-99
{
Console.WriteLine("这个数是两位数");
}
Console.Write("输入学生姓名:");
string name = Console.ReadLine();
Console.Write("输入考试成绩:");
double a = double.Parse(Console.ReadLine());
if(a<=100&&a>0)
{
if (a == 100)//排除掉100
{
Console.WriteLine("恭喜," + name + "满分通过");
}
else//剩下0-99
{
if (a >= 80)//排除90-80的
{
Console.WriteLine("" + name + "你很优秀,请继续保持");
}
else//剩下0-79的
{
if (a >= 60)//排除60以上的
Console.WriteLine("" + name + "成绩良好");
else
{
if (a >= 50)//排除50以上的
{
Console.WriteLine(name + "就差一点点,下次一定要及格");
}
else//剩下0-49的
{
Console.WriteLine(name + "你是笨蛋吗?");
}
}
}
onsole.Write("请输入一个数:");
int x = int.Parse(Console.ReadLine());
Console.Write("请再输入一个数:");
int y = int.Parse(Console.ReadLine());
Console.Write("请再输入一个数:");
int z = int.Parse(Console.ReadLine());
int zhong;
if(x>y)
{
zhong =x;
x=y;
y=zhong;
}
if(x>z)
{
zhong=x;
x=z;
z=zhong;
}
if(y>z)
{
zhong =y;
y=z;
z=zhong;
}
Console.Write(x+"" +y+""+z);
}
string a =Console.ReadLine();
if(a=="能")
{
Console.WriteLine("你比禽兽还禽兽");
}
else if (a == "不能")
{
Console.WriteLine("你连禽兽都不如");
}
else
{
Console.WriteLine("输入有误!");
}
Console.ReadLine();
//判断输入的内容是(能)或者(不能) 还是其他
//if() {} elseif(){} ....else{}
}Console.Write("请输入x=");
int x = int.Parse(Console.ReadLine());
Console.Write("请输入Y=");
int Y = int.Parse(Console.ReadLine());
if (x >= Y)
{
Console.WriteLine(x + " " + Y);
}
else
{
int zhong;//利用中间变量,将两个变量的值 进行互换
zhong = x;
x = Y;
Y = zhong;
Console.WriteLine(Y+""+x);
}
Console.ReadLine();
Console.Write("请输入x=");
int x = int.Parse(Console.ReadLine());
Console.Write("请输入Y=");
int Y = int.Parse(Console.ReadLine());
Console.Write("请输入z=");
int z = int.Parse(Console.ReadLine());
if (x < Y && x < z)
{
Console.WriteLine(x);
if (Y < z)
{
Console.WriteLine(Y); Console.WriteLine(z);
}
else
{
Console.WriteLine(z); Console.WriteLine(Y);
}
}
if (Y < x && Y < z)
{
{
Console.WriteLine(Y);
}
if (x < z)
{
Console.WriteLine(x); Console.WriteLine(z);
}
else
{
Console.WriteLine(z); Console.WriteLine(x);
}
}
if (z < x && z < Y)
{
{
Console.WriteLine(z);
}
if (x < Y)
{
Console.WriteLine(x); Console.WriteLine(Y);
}
else
{
Console.WriteLine(Y); Console.WriteLine(x);
}
}
Console.WriteLine("输入一个小于等于100的整数:");
int a = int.Parse(Console.ReadLine());
if (a <= 100)//先保证输入的数是小于等于100
{
if (a < 10)//先排除小于十的
{
Console.WriteLine("这是个小于10的整数");
}
else//剩下10-100
{
if (a == 100)
{
Console.WriteLine("这个数是100!");
}
else//剩下的就是10-99
{
Console.WriteLine("这个数是两位数");
}
Console.Write("输入学生姓名:");
string name = Console.ReadLine();
Console.Write("输入考试成绩:");
double a = double.Parse(Console.ReadLine());
if(a<=100&&a>0)
{
if (a == 100)//排除掉100
{
Console.WriteLine("恭喜," + name + "满分通过");
}
else//剩下0-99
{
if (a >= 80)//排除90-80的
{
Console.WriteLine("" + name + "你很优秀,请继续保持");
}
else//剩下0-79的
{
if (a >= 60)//排除60以上的
Console.WriteLine("" + name + "成绩良好");
else
{
if (a >= 50)//排除50以上的
{
Console.WriteLine(name + "就差一点点,下次一定要及格");
}
else//剩下0-49的
{
Console.WriteLine(name + "你是笨蛋吗?");
}
}
}
onsole.Write("请输入一个数:");
int x = int.Parse(Console.ReadLine());
Console.Write("请再输入一个数:");
int y = int.Parse(Console.ReadLine());
Console.Write("请再输入一个数:");
int z = int.Parse(Console.ReadLine());
int zhong;
if(x>y)
{
zhong =x;
x=y;
y=zhong;
}
if(x>z)
{
zhong=x;
x=z;
z=zhong;
}
if(y>z)
{
zhong =y;
y=z;
z=zhong;
}
Console.Write(x+"" +y+""+z);
}
相关文章推荐
- selenium+webdriver+java(基本小例子及初始化三种浏览器)---------------
- C语言文法分析
- [OOM]记一次线上OOM的问题
- iOS开发关于位置的三个结构
- iOS App 审核被拒的原因搜罗
- Windows下搭建PHP开发环境(Apache+PHP+MySQL)+调试工具Xdebug的配置
- [转]js之this,call,apply用法
- text输入框中按下enter键时阻止刷新页面
- HTTP协议基础
- [mysql innodb]mysql for update
- 判断是否是周六,周天
- Leetcode Longest Palindromic Substring(最长回文字串)
- c 语言 复杂链表的复制
- 菜鸟眼中的三层架构
- PHP Twig模版的function详解(中文)
- 手机数据恢复华为荣耀X1智能手机32G内置存储手机严重损坏恢复照片聊天记录文档
- junit测试进阶
- matlab矩阵的表示和简单操作
- SpringMVC Controller介绍
- 使用setjmp的时候,同一个信号只能触发一次