摘要:
#region 10、从键盘输入1个人的工资(1000—9999之间的整数),计算给这个人发工资时,需面值100元,50元,20元,10元,5元,2元和1元的人民币各多少张?输出总张数最少的10种方案。 //*优先使用100的 这里只求出了数量最少的一种 int pay = 0; while (true) { Console.WriteLine("请输入工资:"); pay = int.Parse(Consol... 阅读全文
posted @ 2013-10-10 11:19
LifeForCodes
阅读(1938)
评论(0)
推荐(0)
摘要:
#region //9、用一元人民币兑换成1分、2分和5分硬币,编程,输出所有不同的兑换方法及兑换方法个数。 //9、用一元人民币兑换成1分、2分和5分硬币,编程,输出所有不同的兑换方法及兑换方法个数。 //1.全部1分、2分、5分 3种 1分、2分 1分、5分 2分、5分 //假如是1元 1分最多100个 2分最多50个 5分最多20个 Console.WriteLine("请输入要兑换的金额(单位:元):"); ... 阅读全文
posted @ 2013-10-10 11:13
LifeForCodes
阅读(3184)
评论(0)
推荐(0)
摘要:
#region //8、颠倒任意一个字符串的X个字符(第一个和倒数第一个颠倒,第二个和倒数第二个颠倒 ... ) //8、颠倒任意一个字符串的X个字符(第一个和倒数第一个颠倒,第二个和倒数第二个颠倒 ... ) Console.WriteLine("请输入要颠倒的字符串:"); string repeatStr = Console.ReadLine(); int number = 0; while (true) { Console.W... 阅读全文
posted @ 2013-10-10 11:04
LifeForCodes
阅读(561)
评论(0)
推荐(0)
摘要:
#region //7、统计一句英语中 大写英文字母、小写英文字母、数字、空格、标点符号 出现的个数。 [提示:Char msdn] //7、统计一句英语中 大写英文字母、小写英文字母、数字、空格、标点符号 出现的个数。 [提示:Char msdn] Console.WriteLine("请输入一句英语:"); string input = Console.ReadLine(); // int upperCharCount = 0; int lowerCharCo... 阅读全文
posted @ 2013-10-10 11:02
LifeForCodes
阅读(597)
评论(0)
推荐(0)
摘要:
class Program { static void Main(string[] args) { #region 6、求一个数的偶数位的乘积(个位、百位、万位、百万位 等等 注:不允许操作字符串)。 // 个位、十位、百位、千位、万位、十万位、百万位 float num = 0; while (true) { Console.WriteLin... 阅读全文
posted @ 2013-10-10 10:58
LifeForCodes
阅读(219)
评论(0)
推荐(0)
摘要:
#region 解决方案一 //思路:把所有的位置的值都标为1,,循环判断是3的倍数的位置的值标为2 Console.WriteLine("请输入人数:"); int number = int.Parse(Console.ReadLine()); List lastThree = new List(); int lastResult = 0; int[] intArr = new int[number]; for (int i = 0; i ... 阅读全文
posted @ 2013-10-10 10:42
LifeForCodes
阅读(474)
评论(0)
推荐(0)
浙公网安备 33010602011771号