例如:3601秒 = 1h1s
public string secondToNomalTime(int seconds){
int h = seconds / 3600;
int m = seconds % 3600 / 60;
int s = seconds % 60;
string t = "";
t += (h > 0) ? (h+"h") : "";
t += (m > 0) ? (m+"m") : "";
t += (s > 0) ? (s+"s") : "";
return t;
}
其实这样计算量很大,你还有什么好算法?