【c】小红的漂亮串

cs 复制代码
#include<stdio.h>
#include<string.h>
int main()
{
	char arr[1000];
	int count=0;
	gets(arr);//在数组中输入字符串
	int len=strlen(arr);//求字符串长度
	printf("%d\n",len);
	for(int i=0;i<len;i++)
	{
		if(arr[i]=='r')
		{
			if(arr[i+1]=='e')
			{
				if(arr[i+2]=='d')
				{
					count=count+1;
				}
			}
		}
	}
	printf("%d\n",count);
	if(count>=2)
	{
		printf("Yse\n");
	}
	else
	{
		printf("No\n");
	}
	return 0;
}
相关推荐
春风解人意5 小时前
从零开始学习嵌入式P32----网络基础之TCP
c语言·网络·学习·tcp/ip
政企项目老覃7 小时前
大模型幻觉治理与自动评测:金融风控场景的落地实践
人工智能·算法·机器学习
是隼人7 小时前
buuctf-pwn inndy_echo(32位fmt)题解(学习过程持续更新)
c语言·学习·安全·pwn入门·ctf入门
淡海水8 小时前
08-03-不可变-ImmutableDictionary-TKey-TValue-与ImmutableHashSet-T-持久化哈希树
数据结构·算法·c#·哈希算法·dictionary·immutable
hansang_IR8 小时前
【题解】[APIO2023] 赛博乐园 / cyberland
c++·算法·图论
洛阳纸贵8 小时前
MATLAB-matlab基础知识
学习·算法·matlab
落羽的落羽8 小时前
【AI】快速理解AI应用的相关名词概念
linux·c++·人工智能·python·计算机网络·算法
Nil2088 小时前
leetcode 17电话号码的字母组合
算法·leetcode·职场和发展
刃神太酷啦9 小时前
Redis 进阶核心:持久化 (RDB/AOF)、事务与主从复制全解析----《Hello Redis!》(5)
linux·c语言·数据库·c++·redis·缓存·bootstrap