人品计算器

来源:互联网 发布:适合油皮的水乳 知乎 编辑:程序博客网 时间:2024/04/29 02:05
  1. //  
  2. // Copyright (c) 2014软件技术1班  
  3. // All rights reserved.   
  4. // 作    者:A30  黄勇华  
  5. // 完成日期:2014年 12 月 1 日   
  6. // 版 本 号:v1.0   
  7. //   
  8. // 问题描述:编写一个简单的人品计算器
  9. // 输入描述: 输入需要测试的姓名
  10. // 程序输出:输出计算得到的分值和评价
  11. using System;
  12. using System.Collections.Generic;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Threading.Tasks;


  16. namespace 人品计算器
  17. {
  18.     class Program
  19.     {
  20.         static void Main(string[] args)
  21.         {


  22.             
  23.             Console.Title = "人品计算器"; 
  24.             Console.WriteLine("人品评估报告");
  25.             Console.Write("姓名:"); 
  26.             string a = "";  
  27.             string  comment="";
  28.             a  = Console.ReadLine();
  29.              int  b =0;
  30.             for (int i = 0; i < a.Length; i++)
  31.             {
  32.                    b+= (int)a[i];
  33.             }
  34.                   b %= 100;
  35.                  
  36.                   b /= 10;
  37.                
  38.             switch (b)
  39.             { 
  40.               
  41.                
  42.                 case 0:
  43.                 case 1: comment = "你最好快点离开地球!"; break;
  44.                 case 2:
  45.                 case 3: comment = "叫天天不应叫地地不灵"; break;
  46.                 case 4:
  47.                 case 5: comment = "一个回头我就忘了你长啥样了"; break;
                    case 6:
                    case 7: comment = "看你挺顺眼的,我要送你一场造化"; break;
                    case 8:
                    case 9: comment = "你已经能跟上哥的步伐了"; break;








                 
               
                } 
                  if  ( a.Equals("黄勇华") )
                        {
                            b= 100;
                            comment = "哥就是传说";
                        }   
                Console.WriteLine("你的分值为:{0}",b);
                Console.WriteLine("评价:{0}",comment);
                Console .Read();




                
                
                }








            }
        }
  48.    
  49. 输出:
  50.     
  51. 总结:
  52. 1.学会对输入数据的转换处理
  53. 2.学会对数据处理并赋予不同的表达
  54. 2.更加明确对分支的运用
0 0
原创粉丝点击