Blown Garland_Codeforces
来源:互联网 发布:网络公开课网站 编辑:程序博客网 时间:2024/05/17 06:45
虽然一次AC,但还是忍不住说,大水题! 题意:给4个字母,4个为一周期,判断在对应的字母中 存在多少个感叹号。
没什么好说的,我服这水题,提交的时候不小心,在每个输出的结果后面都加了个换行符,也是AC了。。 还花费时间来思考 字符串长度为 4的情况。。。
代码如下:
#include <stdio.h>char s[103];struct MJ{ int num; char ch;}stu[103];void Mj(int n,char s[],int i){ if(s[i]=='!') stu[n].num++; else stu[n].ch=s[i];}void Ll(char chh){ for(int i=0;i<=3;i++){ if(stu[i].ch==chh) printf("%d ",stu[i].num); }}int main(){ scanf("%s",s); for(int i=0;s[i]!='\0';i++) Mj(i%4,s,i); Ll('R');Ll('B');Ll('Y');Ll('G'); printf("\n"); return 0;}
0 0
- Blown Garland_Codeforces
- Blown Garland
- Codeforces758B Blown Garland
- 【Codeforces 758 Blown Garland】
- B. Blown Garland
- Blown Garland CodeForces
- 【codeforces 758B】Blown Garland
- Codeforces #392 B. Blown Garland
- Codeforces 758B-Blown Garland
- CodeForces 758B Blown Garland
- CF758 B. Blown Garland (模拟)
- 颜色不同的灯-Blown Garland
- Codeforces Round #392 (Div. 2)Blown Garland
- cf 758 B. Blown Garland模拟
- 一种处理stack blown异常的简单方法
- CF-Codeforces Round #392 (Div. 2)-B-Blown Garland
- Codeforces Round #392 (Div. 2) B - Blown Garland
- Codeforces Round #392 (Div. 2)-B. Blown Garland(水题)
- 重定向和请求转发的区别
- Re:从零开始的实习生活03----Datatables的使用说明
- springsecurity ajax超时返回登录页面
- android自定义Dialog样式
- 计算机算法设计与分析(1)--算法概述
- Blown Garland_Codeforces
- 【2.1】Python基础——数据类型
- 设计模式之命令模式
- LeetCode_389-Find the Difference
- php使用Iterator接口,逐行遍历文件
- Java语言中==和equals的区别详解
- 正方形共享存储器
- Gotta Catch Em' All!_Codeforces
- 1120. Friend Numbers