秒表制作
public string miaobiao(int t)
{
string hh, mm, ss, mms;
int temp = t / 100;
int h = temp / 3600;
int m = temp / 60 % 60;
int s = temp % 60;
int ms = t % 100;
if (ms < 10)
{ mms = "0" ms.ToString(); }
else
{ mms = ms.ToString(); }
if (s < 10)
{ ss = "0" s.ToString(); }
else
{ ss = s.ToString(); }
if (m < 10)
{ mm = "0" m.ToString(); }
else {
mm = ms.ToString(); }
if (h < 10)
{ hh = "0" h .ToString(); }
else
{ hh = h.ToString(); }
return hh ":" mm ":" ss "." mms;
}
评论