热情软件屋

 

如何使用Do ... Loop


编号:QA001991
建立日期: 1999年11月8日 最后修改日期:1999年11月8日
所属类别:

Joanny TM Yip:
    操作系统: VB6
    编程工具: Loop
    问题: The question is:
     Teacher Student
    Height 165 cm 240 cm
    GrowthRate 2cm/M 1cm/M
    Assume the groth rate isn't changed with time.
    Write the code to calculate the number of months the teacher will be taller than the student. It need to use Top-checking loop -- Do Until ...Loop.

回答:

    Techer = 165
    Student = 240
    n = 0
    Do Until Techer > Student
     Techer = Techer + 2
     Student = Student + 1
     n= n + 1
    Loop
    Print n

此问题由李海回答。

 
把这个问题推荐给朋友
   
   
您的意见类别
您的名字
您的电子邮件
您的建议(请尽可能详细)
 
 

版权所有 1997-2008 热情软件屋
如果您有任何建议和意见, 请给我发个电子邮件 askpro@china-askpro.com
Web Designed by ZebraStudio