problemscpp
A collection of my answers to algorithm problems in c++.
函数
pat::b::b1026 命名空间参考

1026 程序运行时间 更多...

函数

int main (istream &cin, ostream &cout)
 
 TEST (b1026, case1)
 

详细描述

1026 程序运行时间

函数说明

◆ main()

int pat::b::b1026::main ( istream &  cin,
ostream &  cout 
)

在文件 pat.cpp866 行定义.

866 {
867 unsigned int c1;
868 unsigned int c2;
869 cin >> c1 >> c2;
870 unsigned int d = (c2 + 50 - c1) / 100;
871 const unsigned int h = d / 3600;
872 d %= 3600;
873 const unsigned int m = d / 60;
874 d %= 60;
875 const unsigned s = d;
876 cout << setw(2) << right << setfill('0') << h << ':' << setw(2) << right << setfill('0') << m << ':' << setw(2) << right << setfill('0') << s;
877 return 0;
878 }

引用了 acwing::acwing1929::right.

被这些函数引用 TEST().

◆ TEST()

pat::b::b1026::TEST ( b1026  ,
case1   
)

在文件 pat_test.cpp393 行定义.

393 {
394 istringstream in("123 4577973");
395 auto out = ostringstream();
396 main(in, out);
397 const auto ans = out.str();
398 ASSERT_EQ("12:42:59", out.str());
399 }
int main(int argc, char **argv)
Definition: main.cpp:5

引用了 main().