问题:设有一阶梯,每步跨2阶,最后余1阶;每步跨3阶,最后余2阶;每步跨5阶,最后余4阶;每步跨6阶,最后余5阶;每步跨7阶,刚好到阶顶,问共有多少阶梯?
using System;namespace ConsoleApplication1
{class Program{static void Main(string[] args){int i = 1;while (!((i % 2 == 1) && (i % 3 == 2) && (i % 5 == 4) && (i % 6 == 5) && (i % 7 == 0))){i++;}Console.WriteLine(i);}}
}
答案:119