软件1班人品计算器1.0作业

来源:互联网 发布:定义一个变量sql 编辑:程序博客网 时间:2024/06/06 14:00

// Copyright (c) 2014软件1班      // All rights reserved.      // 作者:A04潘保健      // 完成日期:2014年11月27号      // 版 本 号:v1.0      // 问题描述:编写一个程序进行计算名字unicode编码,经过处理得到人品值。using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 人品计算器1{    class Program    {        static void Main(string[] args)        {            Console.Title = "人品计算机控制台版本1.0";            Console.WriteLine("请输入姓名");            string strName = "";            strName = Console.ReadLine();            int score = 0;            foreach (char subName in strName)                score += subName;            score %= 100;            string comment = "";            if (score <= 20) comment = "非人类,无法评价!";            else if (score <= 40) comment = "拜李宇春哥不灵,叫都敏俊xi不应的倒霉蛋";            else if (score <= 60) comment = "掉人堆里都找不出来的普通人……";            else if (score <= 80) comment = "拥有滑板鞋的思想富足者";            else comment = "掌控蓝翔挖掘机技术的宇宙强者";            if (strName.Equals("潘保健"))                {                    score = 101;                    comment = "NB到自己都怕";                }            Console.Clear();            Console.WriteLine("人品评估报告");            Console.WriteLine("姓名:{0}", strName);            Console.WriteLine("分值:{0}", score);            Console.WriteLine("评价:{0}", comment);            Console.ReadKey(true);        }    }}


输出:

总结:通过此次作业了解到了char的运用。

0 0
原创粉丝点击