problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
luogu::P5707类 参考

洛谷 P5707 【深基2.例12】上学迟到 更多...

#include <luogu.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

洛谷 P5707 【深基2.例12】上学迟到

在文件 luogu.h114 行定义.

成员函数说明

◆ main()

int luogu::P5707::main ( istream &  cin,
ostream &  cout 
)
static

在文件 luogu.cpp316 行定义.

316 {
317 unsigned int s;
318 unsigned int v;
319 cin >> s >> v;
320 double t = 8 * 60 - (static_cast<double>(s) / static_cast<double>(v) + 10);
321 if(t < 0) {
322 t += 24 * 60;
323 }
324 const int h = static_cast<int>(t / 60);
325 const int m = static_cast<int>(t) % 60;
326 if(h < 10) {
327 cout << 0;
328 }
329 cout << h << ":";
330 if(m < 10) {
331 cout << 0;
332 }
333 cout << m;
334 return 0;
335 }

被这些函数引用 luogu::TEST().


该类的文档由以下文件生成: