UVA340 - Master-Mind Hints
来源:互联网 发布:理财产品网络推广方案 编辑:程序博客网 时间:2024/04/18 09:15
参考了标程,然后做了修改基本是标程
#include<stdio.h></span>
#include<string.h>#define N 1005int main(){ int n , a[N] , b[N] ; int u= 0; while(scanf("%d",&n)&&n) { int i,j; for(i=0;i<n;i++) scanf("%d",&a[i]); printf("Game %d:\n",++u); while(1){ int x=0,y=0,br=1; for(i=0;i<n;i++){ scanf("%d",&b[i]); if(a[i]==b[i]) x++; if(b[i]) br=0; } if(br) break; for(i=0;i<=9;i++){ int cop1=0,cop2=0; for(j=0;j<n;j++){ if(a[j]==i) cop1++; if(b[j]==i) cop2++; } if(cop1<cop2) y+=cop1; else y+=cop2; } printf(" (%d,%d)\n",x,y-x); } } return 0;}
0 0
- uva340 - Master-Mind Hints
- UVa340 Master-Mind Hints
- UVA340 - Master-Mind Hints
- UVA340 Master-Mind Hints
- uva340 - Master-Mind Hints
- UVA340 - Master-Mind Hints
- UVa340 Master-Mind Hints
- uva340 Master-Mind Hints
- UVa340-Master-Mind Hints
- UVa340 Master-Mind Hints
- UVA340 UVALive5448 Master-Mind Hints
- Master-Mind Hints—UVa340
- Master-Mind Hints UVa340 排序&&查找
- UVa340——Master-Mind Hints
- 340 - Master-Mind Hints
- uva_340 - Master-Mind Hints
- uva_340 - Master-Mind Hints
- 340 - Master-Mind Hints
- system.currentTimeMillis() 将时间存储为int类型
- Flash builder 4.6 注册
- TOMCAT下配置项目路径
- Oracle 11g 导出空表方法
- enum的好处与 define 的区别
- UVA340 - Master-Mind Hints
- Linux中VMware虚拟机增加磁盘空间的扩容操作
- mysql远程访问授权,创建用户并授权
- Android开源项目汇总
- R语言中最强的神经网络包RSNNS
- 设计模式-观察者模式
- 10个你能参与并学习的Java开源github项目
- 大数据十大经典算法之EM算法
- 通过FPGA驱动OV5640调试记录