项目二第2题-计算分秒.c 339 B

1234567891011121314151617
  1. #include <stdio.h>
  2. int main() {
  3. int total_seconds, minutes, seconds;
  4. // 输入总秒数
  5. scanf("%d", &total_seconds);
  6. // 计算分钟和秒数
  7. minutes = total_seconds / 60;
  8. seconds = total_seconds % 60;
  9. // 输出转换后的时间
  10. printf("%dmin%ds\n", minutes, seconds);
  11. return 0;
  12. }