[codeforces 1285A] Mezo Playing Zoma 字符串

[codeforces 1285A] Mezo Playing Zoma 字符串

总目录详见https://blog.csdn.net/mrcrack/article/details/103564004

在线测评地址https://codeforces.com/contest/1285/problem/B

Problem Lang Verdict Time Memory
A - Mezo Playing Zoma GNU C++11 Happy New Year! 31 ms 0 KB
#include <stdio.h>
int n;
char s[100010];
int main(){
	int l=0,r=0,i;
	scanf("%d%s",&n,s+1);
	for(i=1;i<=n;i++){
		if(s[i]=='L')l++;
		else if(s[i]=='R')r++;
	}
	printf("%d\n",l+r+1);
	return 0;
}
发布了475 篇原创文章 · 获赞 509 · 访问量 42万+

猜你喜欢

转载自blog.csdn.net/mrcrack/article/details/103939346
今日推荐