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

1011 A+B 和 C 更多...

函数

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

详细描述

1011 A+B 和 C

函数说明

◆ main()

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

在文件 pat.cpp325 行定义.

325 {
326 long long a;
327 long long b;
328 long long c;
329 int n;
330 cin >> n;
331 for(int i = 1; i <= n; i++) {
332 cin >> a >> b >> c;
333 cout << "Case #" << i << ": " << (a + b > c ? "true" : "false") << endl;
334 }
335 return 0;
336 }

被这些函数引用 TEST().

◆ TEST()

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

在文件 pat_test.cpp144 行定义.

144 {
145 istringstream in("4\n"
146 "1 2 3\n"
147 "2 3 4\n"
148 "2147483647 0 2147483646\n"
149 "0 -2147483648 -2147483647");
150 auto out = ostringstream();
151 main(in, out);
152 const auto ans = out.str();
153 ASSERT_EQ("Case #1: false\n"
154 "Case #2: true\n"
155 "Case #3: true\n"
156 "Case #4: false\n",
157 ans);
158 }
int main(int argc, char **argv)
Definition: main.cpp:5

引用了 main().