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

AcWing 775. 倒排单词 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 775. 倒排单词

在文件 acwing.h1285 行定义.

成员函数说明

◆ main()

int acwing::acwing775::main ( istream &  cin,
ostream &  cout 
)
static

在文件 acwing.cpp4150 行定义.

4150 {
4151 auto *str = new char[101];
4152 auto *str_rev = new char *[101];
4153 int i = 0;
4154 cin.getline(str, 101);
4155 for(char *word = strtok(str, " "); word != nullptr; word = strtok(nullptr, " ")) {
4156 str_rev[i++] = word;
4157 }
4158 for(int j = i - 1; j >= 0; j--) {
4159 cout << str_rev[j] << " ";
4160 }
4161 delete[] str;
4162 delete[] str_rev;
4163 return 0;
4164 }

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


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