题解:读懂题意按照题意模拟。。。

熟悉了一个库函数,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 ;
}

最新文章

  1. DotLiquid模板引擎简介
  2. json对象
  3. objective-c与c++的差异
  4. 20145235 《Java程序设计》第10周学习总结
  5. ExtJS 提示
  6. FE: Sass and Bootstrap 3 with Sass
  7. Java,JSP,JavaScript三和差异
  8. unsupported major.minor version 52.0,错误
  9. matlab中同一文件定义子函数的方法
  10. Java 中的语法糖
  11. 张高兴的 Windows 10 IoT 开发笔记:BH1750FVI 光照度传感器
  12. 洛谷P3375 - 【模板】KMP字符串匹配
  13. 七 Git版本控制
  14. jar 接收utf-8字符乱码现象
  15. C 程序与 C++ 程序之间的相互调用
  16. codeforces472C
  17. DB2常用命令整理
  18. Selenium Web 自动化 - 项目实战(二)
  19. 浅谈MSSQL2012中的列存储索引(columnstore indexes)
  20. day 27 多态 接口 类方法 静态方法 hashlib 摘要算法模块

热门文章

  1. js函数定义参数个数和实际传入参数的对比
  2. Do not have XXX handler in current page
  3. [Lintcode]Inorder Successor in Binary Search Tree(DFS)
  4. linux命令之grep,find
  5. 深度卷积网络-Inception系列
  6. JS 识别生日、性别、年龄
  7. 洛谷P2029 跳舞
  8. Invalid YGDirection &#39;vertical&#39;. should be one of: ( inherit, ltr, rtl )
  9. C# Dictionary类型转json方法之一
  10. HDU-2119-Matrix(最大匹配)