CF Gym 100637G \#TheDress (水)
2024-09-03 20:39:23
题解:读懂题意按照题意模拟。。。
熟悉了一个库函数,strstr,memcpy
#include<cstdio>
#include<cstring> int main()
{
int N;
char str[];
int cnt[] = {};
scanf("%d",&N); getchar();
for(int j = ; j < N; j++){
gets(str);
if(strstr(str,"black")&&strstr(str,"blue")) cnt[]++;
else if(strstr(str,"white")&&strstr(str,"gold")) cnt[]++;
else cnt[]++;
}
double sum = cnt[] + cnt[] + cnt[];
printf("%.10lf\n%.10lf\n%.10lf",cnt[]/sum*,cnt[]/sum*,cnt[]/sum*);
return ;
}
最新文章
- DotLiquid模板引擎简介
- json对象
- objective-c与c++的差异
- 20145235 《Java程序设计》第10周学习总结
- ExtJS 提示
- FE: Sass and Bootstrap 3 with Sass
- Java,JSP,JavaScript三和差异
- unsupported major.minor version 52.0,错误
- matlab中同一文件定义子函数的方法
- Java 中的语法糖
- 张高兴的 Windows 10 IoT 开发笔记:BH1750FVI 光照度传感器
- 洛谷P3375 - 【模板】KMP字符串匹配
- 七 Git版本控制
- jar 接收utf-8字符乱码现象
- C 程序与 C++ 程序之间的相互调用
- codeforces472C
- DB2常用命令整理
- Selenium Web 自动化 - 项目实战(二)
- 浅谈MSSQL2012中的列存储索引(columnstore indexes)
- day 27 多态 接口 类方法 静态方法 hashlib 摘要算法模块
热门文章
- js函数定义参数个数和实际传入参数的对比
- Do not have XXX handler in current page
- [Lintcode]Inorder Successor in Binary Search Tree(DFS)
- linux命令之grep,find
- 深度卷积网络-Inception系列
- JS 识别生日、性别、年龄
- 洛谷P2029 跳舞
- Invalid YGDirection &#39;vertical&#39;. should be one of: ( inherit, ltr, rtl )
- C# Dictionary类型转json方法之一
- HDU-2119-Matrix(最大匹配)