📌  相关文章
📜  在线将c代码转换为python代码 - Python代码示例

📅  最后修改于: 2022-03-11 14:45:17.818000             🧑  作者: Mango

代码示例2
include
int get_palindrome_time(char str[]) 
{ 
    int hh, mm; 
    hh = (str[0] - 48) * 10 + (str[1] - 48); 
    mm = (str[3] - 48) * 10 + (str[4] - 48); 
    int requiredTime = 0; 
    while (hh % 10 != mm / 10 || hh / 10 != mm % 10) 
    { 
      ++mm; 
      if (mm == 60) 
      { 
         mm = 0; 
         ++hh; 
       }  
        if (hh == 24) 
            hh = 0; 
      ++requiredTime; 
    } 
    return requiredTime; 
} 
int main() 
{ 
    char str[6];
    scanf("%s",str);
    printf("%d",get_palindrome_time(str)); 
}