http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1396

1396: Erase Securely

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 102  Solved: 60
[Submit][Status][Web Board]

Description

csuoj 1396: Erase Securely-LMLPHP

Input

csuoj 1396: Erase Securely-LMLPHP

Output

csuoj 1396: Erase Securely-LMLPHP

Sample Input

1
10001110101000001111010100001110
01110001010111110000101011110001

Sample Output

Deletion succeeded

HINT

csuoj 1396: Erase Securely-LMLPHP

Source

分析;
就是01互换,然后对比两个串的异同。

AC代码:

 #include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<iostream>
#include<stack>
#include<map>
#include<string>
using namespace std;
char ch1[], ch2[];
int main(){
int n;
while(~scanf("%d", &n)){
scanf("%s%s", ch1, ch2);
int l = strlen(ch1);
if(n% == )
for(int i = ; i < l; i++)
if(ch1[i] == '')
ch1[i]--;
else if(ch1[i] == '')
ch1[i]++;
if(strcmp(ch1, ch2) == )
printf("Deletion succeeded\n");
else
printf("Deletion failed\n");
}
return ;
}
05-11 14:00