using System;
namespace program
{
class program1
{
static void Main(string[] args)
{
program1 fenshu = new program1();
fenshu.Panduan();
program1 tian = new program1();
tian.Tianshu();
}
/// <summary>
/// 计算一年中的第几天
/// </summary>
void Tianshu()
{
Console.Write("请输入年份=");
int a = Convert.ToInt32(Console.ReadLine());
Console.Write("请输入月份=");
int b = Convert.ToInt32(Console.ReadLine());
Console.Write("请输入日=");
int c = Convert.ToInt32(Console.ReadLine());
int total = ;
if ((total % == && total % != ) || (total % == ))//是否闰年的判断
{
total = ;
}
switch (b)
{
case : total -= ; goto case ;
case :
if ((total % == && total % != ) || (total % == ))//闰年二月份有29天
total -= ; //一层可以不使用块
else
total -= ;
goto case ;
case : total -= ; goto case ;
case : total -= ; goto case ;
case : total -= ; goto case ;
case : total -= ; goto case ;
case : total -= ; goto case ;
case : total -= ; goto case ;
case : total -= ; goto case ;
case : total -= ; goto case ;
case : total -= ; goto case ;
case : total -= ; goto default;
default: total += c; break;
}
Console.WriteLine("{0}年{1}月{2}日是一年的第{3}天", a, b, c, total);
}
/// <summary>
/// 练习switch
/// </summary>
void Panduan()
{
Console.Write("请输入学生等级的值=");
string a = Console.ReadLine();
switch (a)
{
case "A": Console.WriteLine("85-100"); break;
case "B": Console.WriteLine("70-84 "); break;
case "C": Console.WriteLine("60-69"); break;
case "D": Console.WriteLine("不及格"); break;
default: Console.WriteLine("输入有误"); break;
}
}
}
}

最新文章

  1. c++用法的学习心得
  2. make命令以及makefile
  3. 例子:Database - Linq to sql
  4. 【读书笔记】iOS-头文件导入-@class注意事项
  5. 监听turtlesim仿真器,发送数据到实际的机器人--20
  6. 5个基于css3超炫的鼠标滑动按钮动画
  7. vi编辑器基本用法介绍
  8. 一步步学习NHibernate(1)&mdash;&mdash;NHibernate介绍
  9. 【从0開始Tornado建站】群聊
  10. 使用javaDate类代数据仓库维度表
  11. TypeScript入门(二)函数新特性
  12. ●CodeForces 429D Trick_Function
  13. 二进制数据的序列化反序列化和Json的序列化反序列化的重要区别
  14. emWin收音机,含uCOS-III和FreeRTOS两个版本
  15. 2.3 i++/i--与++i/--i的运算
  16. C++面试基础之回调
  17. 使用FluentMigrator进行数据库迁移
  18. rabbitmq学习(七) —— springboot下的可靠使用
  19. 把旧系统迁移到.Net Core 2.0 日记 (16) --Cors跨域访问
  20. 百度全站 https FAQ:技术宅告诉你如何搜索更安全

热门文章

  1. python爬取网页数据
  2. Linux查看文件或文件夹大小du命令
  3. java架构之-负载均衡-Ribbon 的使用
  4. 使用PrintWriter完成写操作 ,实现简易记事本工具
  5. iOS 中UICollectionView实现各种视觉效果
  6. JUnit与MSTest
  7. 032.[转] Java集合框架
  8. TICK技术栈(四)Grafana安装及使用
  9. pip 查看软件包 可用版本并安装; pip 查看 numpy 可用版本并安装
  10. 压测工具ab