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

洛谷 P1321 单词覆盖还原 更多...

#include <luogu.h>

静态 Public 成员函数

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

详细描述

洛谷 P1321 单词覆盖还原

在文件 luogu.h555 行定义.

成员函数说明

◆ main()

int luogu::P1321::main ( istream &  cin,
ostream &  cout 
)
static

在文件 luogu.cpp2049 行定义.

2049 {
2050 string str;
2051 string boygirl[] = {"boy", "girl"};
2052 cin >> str;
2053 for(auto word: boygirl) {
2054 int count = 0;
2055 for(int i = 0; i + word.length() - 1 < str.length(); i++) {
2056 for(int j = 0; j < word.length(); j++) {
2057 if(word[j] == str[i + j]) {
2058 count++;
2059 break;
2060 }
2061 }
2062 }
2063 cout << count << endl;
2064 }
2065 return 0;
2066 }

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


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