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

1009 说反话 更多...

函数

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

详细描述

1009 说反话

函数说明

◆ main()

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

在文件 pat.cpp285 行定义.

285 {
286 string str;
287 vector<string> strs;
288 while(cin >> str) {
289 strs.push_back(str);
290 }
291 for(int i = strs.size() - 1; i > 0; i--) {
292 cout << strs[i] << ' ';
293 }
294 cout << strs[0];
295 return 0;
296 }

被这些函数引用 TEST().

◆ TEST()

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

在文件 pat_test.cpp124 行定义.

124 {
125 istringstream in("Hello World Here I Come");
126 auto out = ostringstream();
127 main(in, out);
128 const auto ans = out.str();
129 ASSERT_EQ("Come I Here World Hello", ans);
130 }
int main(int argc, char **argv)
Definition: main.cpp:5

引用了 main().