洛谷 P5015 [NOIP2018 普及组] 标题统计 题解 字符串 C/C++

//P5015 [NOIP2018 普及组] 标题统计
//#define LOCAL
#include 
#include 
#include 
#include 
#include 
#include 
#define inf 0x3f3f3f3f
#define eps 1e-6
using namespace std;
#define clr(x) memset(x,0,sizeof((x)))
const int maxn = 5e4+1;//2e6+1
#define MAX(a,b,c) ((a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c)))
#define _max(a,b) ((a) > (b) ? (a) : (b))
#define _min(a,b) ((a) < (b) ? (a) : (b))
#define _for(a,b,c) for(int a = b;a
int readchar() {
	int ch;
	for(;;) {
		ch = getchar();
		if(ch!='\n'&&ch!='\r'&&ch!=' ') return ch;
	}
}
int main() {
#ifdef LOCAL 
	freopen("data.in","r",stdin);
	freopen("data.out","w",stdout);
#endif
	char c;
	int cnt = 0;
	while((c = readchar())!=EOF){
		cnt++;
	}
	cout<<cnt;
	return 0;
}

你可能感兴趣的:(洛谷,c++,c语言,算法)