【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;
}
相关推荐
wadesir2 小时前
Rust中的条件变量详解(使用Condvar的wait方法实现线程同步)
开发语言·算法·rust
yugi9878382 小时前
基于MATLAB实现协同过滤电影推荐系统
算法·matlab
TimberWill2 小时前
哈希-02-最长连续序列
算法·leetcode·排序算法
Morwit2 小时前
【力扣hot100】64. 最小路径和
c++·算法·leetcode
leoufung2 小时前
LeetCode 373. Find K Pairs with Smallest Sums:从暴力到堆优化的完整思路与踩坑
java·算法·leetcode
wifi chicken3 小时前
数组遍历求值,行遍历和列遍历谁更快
c语言·数据结构·算法
qingyun9893 小时前
深度优先遍历:JavaScript递归查找树形数据结构中的节点标签
前端·javascript·数据结构
胡楚昊3 小时前
NSSCTF动调题包通关
开发语言·javascript·算法
Gold_Dino4 小时前
agc011_e 题解
算法
bubiyoushang8884 小时前
基于蚁群算法的直流电机PID参数整定 MATLAB 实现
数据结构·算法·matlab