用C#解答,一天内时针,分针,秒针重合多少次?

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 06:01:27
用C#解答,一天内时针,分针,秒针重合多少次?

用C#解答,一天内时针,分针,秒针重合多少次?
用C#解答,一天内时针,分针,秒针重合多少次?

用C#解答,一天内时针,分针,秒针重合多少次?
用楼上的方法写的代码
using System;
class A
{
static void Main()
{
int count = 0 ;
for(int n = 1 ; n 360)
{
AngleMinAndHour = AngleMinAndHour-360;
}
while(AngleSecAndHour > 360)
{
AngleSecAndHour = AngleSecAndHour-360;
}
if(AngleSecAndHour ==AngleMinAndHour)
{
count ++ ;
}
}
Console.WriteLine(count);
Console.Read();
}
}