专升本VF程序设计复习资料(CH2算法).docVIP

  • 12
  • 0
  • 约1.08万字
  • 约 20页
  • 2016-10-26 发布于浙江
  • 举报
CH2 结构化程序设计语句和算法 顺序结构 求园的面积 Clear Input “请输入园的半径:” to r S=pi()*r^2 ?”园的面积是:”,s 鸡兔同笼问题 选择结构 if 判断闰年 Clear Input “请输入年份:” to y If (y%4=0 and y%1000) or y%400=0 ?y,”是闰年!” Else ?y,”是闰年!” endif cancel do case 判断学生成绩等级 clear input 请输入学生成绩: to x if x100 or x0 then ?输入成绩必须位于0-100之间 else do case case x=90 ?等级为A case x=80 ?等级为B case x=70 ?等级为C case x=60 ?等级为D other ?等级为E endcase endif cancel 3. 判断一个数是否是水仙花数。 clear input m= to m x=int(m/100) y=int((m%100)/10) z=m%10 if x^3+y^3+z^3=m ?m,是水仙花数 else ?m,不是水仙花数 endif cancel 循环结构 3.1 Do whi

文档评论(0)

1亿VIP精品文档

相关文档