注意:理清逻辑,画出逻辑分支图,理清思路

1.if语句

2.if...else语句

3.if..else if...else

 static void Main(string[] args)
{
Console.WriteLine("输入分数:"); string fs = Console.ReadLine();
int score = Convert.ToInt32(fs); #region 判断分数
if (score >= && score < )
{
Console.WriteLine("不及格,补考");
}
else if (score >= && score < )
{
Console.WriteLine("恭喜及格");
}
else if (score >= && score <= )
{
Console.WriteLine("恭喜优秀");
}
else
{
Console.WriteLine("输入有误");
}
#endregion Console.WriteLine("结束");
}

3.输入分数,如果小于60,再判断加分项,然后输出是否及格

  static void Main(string[] args)
{
Console.WriteLine("输入分数:"); string fs = Console.ReadLine();
int score = Convert.ToInt32(fs); if (score < )
{
Console.WriteLine("是否认真做作业?(是,否)"); string zuoye = Console.ReadLine(); #region ======加分=======
if (zuoye == "是")
{
score = score + ; if (score < )
{
Console.WriteLine("不及格");
}
else
{
Console.WriteLine("凑合及格");
}
}
else
{
Console.WriteLine("不及格了");
}
#endregion
}
else
{ } Console.WriteLine("结束");
}

最新文章

  1. Tomcat下conf下server.xml的文件配置信息
  2. IOS 问题集锦
  3. SQL Server 2014如何提升非在线的在线操作
  4. little skill---ping
  5. 一、spring——helloWorld
  6. CDH hive的安装
  7. Wordpress Jigoshop插件路径泄露漏洞
  8. Android中为窗口定义主题
  9. ftk学习记(waitbox篇)
  10. HDU1686:Oulipo
  11. typedef和define的详细区别
  12. SpringMVC源码情操陶冶-View视图渲染
  13. Win10系统下的Tomcat7.0配置
  14. Spring_Spring与AOP
  15. HTML5 拖放(Drag 和 Drop)详解与实例(转)
  16. .NET下对Web.config与App.Config的增删改操作的代码
  17. 【C++】满二叉树问题
  18. java学习之路--继承(多态的动态绑定)
  19. STM32的型号的命名规则
  20. JAVA Swing使用JFreeChart实现折线图绘制

热门文章

  1. Struts2配置详解_配置Action
  2. ABAP Util代码
  3. Linux Shell脚本攻略 读书笔记
  4. ubuntu下配置hosts
  5. 关于HTML5与移动开发
  6. ubuntu下安装gradle
  7. mysql 有关的文件
  8. thinkphp自动验证方法的使用
  9. Java开发中的一些小技巧
  10. spring-boot资料