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

洛谷 P1980 [NOIP2013 普及组] 计数问题 更多...

#include <luogu.h>

静态 Public 成员函数

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

详细描述

洛谷 P1980 [NOIP2013 普及组] 计数问题

在文件 luogu.h267 行定义.

成员函数说明

◆ main()

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

在文件 luogu.cpp715 行定义.

715 {
716 int n;
717 char x;
718 cin >> n >> x;
719 auto oss = ostringstream();
720 for(int i = 1; i <= n; i++) {
721 oss << i;
722 }
723 const string str = oss.str();
724 int ans = 0;
725 for(const char ch: str) {
726 if(ch == x) {
727 ans++;
728 }
729 }
730 cout << ans;
731 return 0;
732 }

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


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