UVA 340 (暑假-排序、检索 -A - Master-Mind Hints)
来源:互联网 发布:网络液晶广告屏厂家 编辑:程序博客网 时间:2024/05/29 06:38
#include <stdio.h> #include <string.h> int main() {const int Max = 1050;int str_1[Max], str_2[Max], str_3[Max];int t = 1, n;while (scanf("%d", &n), n) {//getchar();printf("Game %d:\n", t++);//gets(str_1);for (int i = 0; i < n; i++)scanf("%d", &str_1[i]);//puts(str_1);while (1) {for (int i = 0; i < n; i++)scanf("%d", &str_2[i]);if (str_2[0] == 0)break;//puts(str_2);memset(str_3, 0, sizeof(str_3));int count_1 = 0, count_2 = 0;for (int i = 0; i < n; i++)if (str_1[i] == str_2[i])count_1++, str_3[i] = 1, str_2[i] = -1; for (int i = 0; i < n; i++) {if (str_3[i] == 1)continue;for (int j = 0; j < n; j++) {if (str_2[j] == -1)continue;else if (str_1[i] == str_2[j]) {str_2[j] = -1, count_2++; //printf("%c count_2 = %d",str_2[j], count_2);break;}}}printf(" (%d,%d)\n", count_1, count_2);}}return 0;}
0 0
- UVA 340 (暑假-排序、检索 -A - Master-Mind Hints)
- 排序检索A - Master-Mind Hints
- uva 340 Master-Mind Hints(检索)
- 排序检索-340 Master-Mind Hints
- UVa 340 Master-Mind Hints
- uva 340 Master-Mind Hints
- UVA 340 - Master-Mind Hints
- UVa 340 - Master-Mind Hints
- UVa 340 Master-Mind Hints
- UVA 340 Master-Mind Hints
- uva 340 Master-Mind Hints
- UVA 340 - Master-Mind Hints
- UVa 340 - Master-Mind Hints
- UVa 340 - Master-Mind Hints
- UVA 340 Master-Mind Hints
- uva 340 Master-Mind Hints
- UVa - 340 - Master-Mind Hints
- UVa 340 - Master-Mind Hints
- [FPGA][硬件课设]基于Nexys 4的智能小车系统
- oracle事务与锁
- POJ-3155-Hard Life
- BFS模板
- cocos2d-x 3.x中各种平台的创建项目命令,运行项目命令、运行testcpp命令
- UVA 340 (暑假-排序、检索 -A - Master-Mind Hints)
- android camera(三):camera V4L2 FIMC
- 代码框架优化
- 判断oracle连接是专用模式/共享模式方法(dedicated/shared)
- Oracle Linux安装的时候监听报错 TNS-00525问题解决办法
- ReportStudio入门教程(六十五) - 生成变量的使用
- Android通过WebService进行网络编程------查询天气
- Centos中IP与DNS手动设置方法
- linux访问0xc0000000以下地址错误原因