// Copyright (c) 2014软件技术2班
// All rights reserved.
// 作 者: B35
// 完成日期:2014年11月24日
// 版 本 号:v1.0
//
// 问题描述:利用C#设计一个简单的人品计算器
// 输入描述: 姓名
// 输出描述:将姓名转换为unicode编码并输出,即所谓的人品(1-100)
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("请输入你的姓名");
string Name = "";
Name = Console.ReadLine();
int score = 0;
for (int i = 0; i < Name.Length; i++)
{
score += (int)Name[i];
}
score %= 100;
string comment = "";
switch (score / 10)
{
case 0:
case 1: comment = "屡送1血的可怜虫"; break;
case 2:
case 3: comment = "闪现撞墙的倒霉蛋"; break;
case 4:
case 5: comment = "闪耀的黄金斗士"; break;
case 6:
case 7: comment = "璀璨的钻石强者"; break;
case 8:
case 9: comment = "超越faker的宇宙强者"; break;
}
Console.Clear();
Console.WriteLine("人品评估报告");
Console.WriteLine("姓名:{0}", Name);
Console.WriteLine("分值:{0}", score);
Console.WriteLine("评价:{0}", comment);
Console.ReadKey(true);
}
}
}
输出:
总结:这个人品计算器大概算是对以前知识的总结了,对前面所学的知识又有了新一次的认识