3
已解决
刘乐宸
新手天翼
新手天翼
#include <iostream>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
using namespace std;
const int MAXN = 10;
string t = "Hello, World!";//题目要求输出的
string ans = "Hello, World!";//对照组
int ms, p=0, fflag = 0, pd, fei;
struct F{
char ml;
bool used;
}px[30*MAXN];
bool check(int n) {
for(int i=1; i<=n; i++) {
if(ans[i] != t[i]) return 1;//判断对照组与实际是否相同
}
return 0;
}
void ensh(int sea) {
if(sea == 0) sea = 0;
if(sea == 1) {
cout << "I can't do this problem!It's so difficult!";
fei = 1;
}
}
bool ff(int du) {
pd = du;
pd -= 1;
du = pd;
if(du != 0) return 1;
return 0;
}
void date(int a, int b) {
if(check(ms)!= 1 && p==0 && ff(fflag)==0 && a+b==2 && fei == 0)
cout << "Hello, World!";
else if(fei == 1) cout << "I can't do this problem!It's so difficult!";
}
int main() {
string ans = "Hello, World!";//对照组
ms = ans.size();
int kk = ms;//寄存
string t = "Hello, World!";//题目要求输出的
check(ms);
int ss = 0;//判断双方长度是否相同
do{
ss++;
}
while(ms --);
ms = kk;
if(ss == (ms-1)) {
p = MAXN;
}
char sh[15][15];//绘制string类型表格
int ii = sqrt(ms);
int jj = kk - ii;
for(int i=1; i<=ii; i++) {
for(int j=1; j<=kk; j++) {
sh[i][j] = t[j];
}
}
for(int i=1; i<=kk; i++) {
if(sh[1][i] == t[i]) {
fflag = 1;
}
}
for(int i=0; i<kk; i++) {
px[i].ml = t[i];
px[i].used = 0;
}
for(int i=0; i<kk; i++){
if(px[i].ml == t[i]) px[i].used = 1;
}
for(int i=0; i<kk; i++) {
if(px[i].used == 0)fei = 1;
}
ensh(fei);
char aa = ' ', bb = 'H';//判断首字母
if(ans[0] == aa && ans[1] !=bb) {
cout << "I can't do this problem!It's so difficult!";
while(true) aa = '0';
return 0;
}
date(p+fei+1, fflag);
return 0;
}
最近在同学那里白嫖来了这个代码,醉了。
helloworld能成这样
1
1
1
1
1
0
0
0
0
0
0
0