智商回归纪念
来源:互联网 发布:税控开票软件下载 编辑:程序博客网 时间:2024/04/30 02:02
脑残了两天
终于正常了
终于正常了
#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
int n;int a[105],b[105],c[105];
while(cin>>n,n)
{
int i;
for(i=0;i<n;i++)
cin>>a[i]>>b[i]>>c[i];
int j,q=0;int d[4],z=0,g;
for(i=1000;i<10000;i++)
{
for(j=0;j<n;j++)
{
d[0]=i/1000; // 忘了怎么转换字符串;
d[1]=(i%1000)/100;
d[2]=(i%100)/10;
d[3]=(i%10);
int e[4];
e[0]=a[j]/1000;
e[1]=(a[j]%1000)/100;
e[2]=(a[j]%100)/10;
e[3]=(a[j]%10);
int x=0,y=0,l;
for(l=0;l<4;l++)
if(e[l]==d[l]) {x=x+1;}
for(l=0;l<4;l++)
{
for(int h=0;h<4;h++)
if(e[l]==d[h]) {y=y+1;d[h]=-1;break;} // 忘了怎么数数
}
if(x==c[j]&&y==b[j]) q=q+1;
else {q=0;break;}
}
if(q==n)
{
z=z+1; 忘了怎么确定一个数
g=i;
}
if(z>1) break; // 临时机智 表示减少无用计算
if(z>1) break; // 临时机智 表示减少无用计算
}
if(z==1) cout<<g<<endl;
else cout<<"Not sure"<<endl;
}
return 0;
}
0 0
- 智商回归纪念
- 智商
- dyx--纪念一下我死去的智商--膜拜我大T神
- 停课开始のflag暨blog回归纪念
- 51nod 1055 等差数列 动态规划入门之战 智商回归
- 纪念
- 纪念
- 纪念
- 纪念
- 纪念
- 纪念
- 纪念
- 纪念
- 纪念
- 纪念
- 纪念
- 纪念。。。
- 纪念
- DOMContentLoaded
- IOS网络——检测网络状态:Reachability,iosreachability
- 集合的工程案例详解
- Aandroid 事件分发机制(二):ViewGroup
- 模型获取得值为<null>转为" "空字符串
- 智商回归纪念
- python pip安装使用
- 室内定位值得参考的网站
- MySQL优化
- Linux之vi命令
- Spring相关
- Java开发中的23种设计模式详解(转)
- 欢迎使用CSDN-markdown编辑器
- [设计模式] 装饰者模式Decorator