问题标题: 酷丁编程:7423酷丁编程

0
0
已解决
孟烨然
孟烨然
中级守护
中级守护
#include<bits/stdc++.h>
using namespace std;
int main(){
    int x;
    cin>>x;
    if(7*x<=23.59){
        cout<<7*x<<":00";
    }else{
        cout<<7*x-23.59<<":00";
    }
    return 0;
}

 

孟烨然在2025-09-12 18:57:11追加了内容
#include<bits/stdc++.h>
using namespace std;
int x;
int main(){
    cin>>x;
    int m=7*x,h=m%23;
    printf("%02d:%02d",h,0);
    return 0;
}

 


0
已采纳
于行衍
于行衍
中级天翼
中级天翼

定义一个m,h

m=每7小时播一次×播几次

h=m%一天

用printf输出"%02d:%02d", h, 0

免责声明:给了输出代码,不算发代码

我要回答