C# 编程题:计算唐老狮视频观众增长所需时间
using System;
class Program
{
static void Main(string[] args)
{
int students = 100;
int months = 0;
while (students < 1000)
{
students += (int)(students * 0.2);
months++;
}
Console.WriteLine("经过 {0} 个月,看唐老狮视频的同学达到了1000人。", months);
}
}
经过 9 个月,看唐老狮视频的同学达到了1000人。
原文地址: https://www.cveoy.top/t/topic/ppNH 著作权归作者所有。请勿转载和采集!