可能是我打开题目的姿势不对,我从题单进来的,说好的顺序结构,一大堆if是怎么回事,for循环都出来了,说好的顺序结构呢...
这题让没学分支结构的宝宝怎么办?
这题用顺序结构怎么解?
折腾一晚上,自己写了一个
请大家帮忙看看
#include <iostream>
#include <string>
using namespace std ;
int main() {
string hour[24] = {"07","06","05","04","03","02",
"01","00","23","22","21","20","19","18","17","16",
"15","14","13","12","11","10","09","08"} ;
double S , V ;
int h , M , m1 , m2 ;
cin >> S >> V ;
h = 1440 - ( 1440 - 10 - S / V ) ;
h = h / 60 ;
M = 1440 - 10 - S / V;
M = M % 60 ;
m1 = M / 10 ;
m2 = M - ( m1 * 10 ) ;
cout << hour[h] << ":" << m1 << m2 ;
}