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

//P5015 [NOIP2018 普及组] 标题统计
//#define LOCAL
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cctype>
#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<c;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;
}

猜你喜欢

转载自blog.csdn.net/Jason__Jie/article/details/112491838