2014年12月27日
摘要: 30人投票,从5个候选人选一个出来。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ConsoleApplication1 7 ... 阅读全文
posted @ 2014-12-27 20:39 酸甜sky 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 数组的应用:(一).冒泡排序。1.冒泡排序是用双层循环解决。外层循环的是趟数,里层循环的是次数。2.趟数=n-1;次数=n-趟数。3.里层循环使用if比较相临的两个数的大小,进行数值交换。作业:1.先把冒泡排序写一遍。2.使用冒泡排序,做青歌赛的打分程序。要求去掉两个最高,两个最低分,求平均得分。代... 阅读全文
posted @ 2014-12-27 20:26 酸甜sky 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1.在案例一的基础上,显示球员总分和平均分以及显示最高分和最低分,以及相应球员的代号。 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespa... 阅读全文
posted @ 2014-12-27 07:28 酸甜sky 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1.break与continue.这两个关键字一般放在循环的花括号里面使用。break——结束整个循环。continue——结束本次循环,进入下次循环。break的案例: int i = 1; for(;;) { if(i>100) { ... 阅读全文
posted @ 2014-12-27 07:23 酸甜sky 阅读(143) 评论(0) 推荐(0) 编辑
  2014年12月24日
摘要: 1.有三种硬币若干:1分,2分,5分。要组合1毛5,有哪些组合方式? 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace Consol... 阅读全文
posted @ 2014-12-24 16:01 酸甜sky 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 应用:迭代法,穷举法。一、迭代法:有一定规律。 每次循环都是从上次运算结果中获得数据,本次运算的结果都是要为下次运算做准备。例:1.100以内所有数的和。2.求阶乘3.求年龄。4.折纸。5.棋盘放粮食( 自己做)6.猴子吃桃子7.落球问题。(自己做)一个球从10米高度落下,每次弹起2/3的高度。问第... 阅读全文
posted @ 2014-12-24 15:51 酸甜sky 阅读(160) 评论(0) 推荐(0) 编辑
  2014年12月23日
摘要: 循环:可以反复执行某段代码,直到不满足循环条件为止。一、循环的四要素:初始条件、循环条件、状态改变、循环体。1.初始条件:循环最开始的状态。2.循环条件:在什么条件下进行循环,不满足此条件,则循环终止。3.状态改变:改变循环变量值,最终不满足循环条件,从而停止循环。4.循环体:要反复执行的部分。二、... 阅读全文
posted @ 2014-12-23 16:58 酸甜sky 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 打印以下图型:行i列ji与j关系●●●●●15●●●●●25●●●●●35●●●●●45●●●●●55 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6... 阅读全文
posted @ 2014-12-23 16:37 酸甜sky 阅读(113) 评论(0) 推荐(0) 编辑
  2014年12月22日
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ConsoleApplication1 7 { 8 class Clas... 阅读全文
posted @ 2014-12-22 21:04 酸甜sky 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 男人的标准体重是:体重(kg)=身高(cm)-100。女人的标准体重是:体重(kg)=身高(cm)-110。上下浮动3公斤属正常要求输入性别、身高和体重,输出正常,偏胖,偏瘦 1 using System; 2 using System.Collections.Generic; 3 using Sy... 阅读全文
posted @ 2014-12-22 21:02 酸甜sky 阅读(205) 评论(0) 推荐(0) 编辑