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

AcWing 773. 字符串插入 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 773. 字符串插入

在文件 acwing.h1235 行定义.

成员函数说明

◆ main()

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

在文件 acwing.cpp3980 行定义.

3980 {
3981 string str;
3982 string substr;
3983 while(cin >> str) {
3984 cin >> substr;
3985 auto oss = ostringstream();
3986 int max_i = 0;
3987 for(int i = 0; i < str.length(); i++) {
3988 if(str[i] > str[max_i]) {
3989 max_i = i;
3990 }
3991 }
3992 oss << str.substr(0, max_i + 1);
3993 oss << substr;
3994 oss << str.substr(max_i + 1);
3995 cout << oss.str() << endl;
3996 }
3997 return 0;
3998 }

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


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