惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
Cisco Talos Blog
Cisco Talos Blog
Y
Y Combinator Blog
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
J
Java Code Geeks
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 聂微东
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Privacy & Cybersecurity Law Blog
L
LangChain Blog
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Privacy International News Feed
F
Full Disclosure
S
Schneier on Security
T
Tenable Blog
量子位
NISL@THU
NISL@THU
Latest news
Latest news
V
Visual Studio Blog
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
博客园_首页
K
Kaspersky official blog
L
Lohrmann on Cybersecurity
美团技术团队
P
Proofpoint News Feed
P
Palo Alto Networks Blog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
AWS News Blog
AWS News Blog
S
Securelist
The Register - Security
The Register - Security
G
GRAHAM CLULEY
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
C
Cisco Blogs

博客园 - 一碗豆芽汤(OneV)

C#一些基础知识回顾 2021年立个Flag,回顾十多年来的IT职业之路-----没事瞎BB 使用 Visual Studio 创建 .NET 5 控制台应用程序 log4net将日志进行分类,保存到不同的目录当中 .net 使用PowerShell获取电脑中的UUID .Net MVC中访问PC网页时,自动切换到移动端对应页面 C# 全角符号转半角 微信开发第二篇:工具篇 微信开发第一篇:问题篇 [转载]ODAC (odp.net) 开发到部署 【项目开发】LigerUI+MVC的应用 VS中两个常用辅助工具 sqlite中常见的问题总结 第1次做面试官的随谈(二) 第1次做面试官的随谈(一) 转,有用 [转载收录]ASP.NET 2.0加密Web.config - 一碗豆芽汤(OneV) - 博客园 关于重构之Switch的处理【二】 - 一碗豆芽汤(OneV) - 博客园 关于重构之Switch的处理【一】如果是有序的话,如何处理
重构的例子
一碗豆芽汤(OneV) · 2011-01-03 · via 博客园 - 一碗豆芽汤(OneV)
在百度知道时拷的一段代码,放上来,下面可以用一些重构的技巧让这段代码更简洁,让人更容易阅读,今晚上想休息了,明天把改进的放上来
static void Main(string[] args)
        {
            Console.WriteLine("请输入成绩(输入-1则退出程序):");
            while (true)
            {
                int tmp = int.Parse(Console.ReadLine());
                if (tmp == -1)
                    break;
                int flag = 0;
                if (tmp >= 90 && tmp <= 100)
                    flag = 1;
                if (tmp >= 75 && tmp <= 89)
                    flag = 2;
                if (tmp >= 60 && tmp <= 74)
                    flag = 3;
                if (tmp <= 59)
                    flag = 4;
                switch (flag)
                {
                    case 1:
                        Console.WriteLine("优秀");
                        break;
                    case 2:
                        Console.WriteLine("良好");
                        break;
                    case 3:
                        Console.WriteLine("一般");
                        break;
                    case 4:
                        Console.WriteLine("不及格");
                        break;
                }
            }
        }