test1-11new

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test1_11new
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("请输入一行原字符串");
string s_text = Console.ReadLine();
Console.WriteLine("请输入密钥字符串");
string s_key = Console.ReadLine();
if(s_text.Length!=s_key.Length)
Console.WriteLine("密钥与字符串长度必须相等");
string ch=null;
string s_result = null ;
for (int i = 0; i < s_text.Length; i++)
{
ch+=s_text[i];
s_result+= (char)(ch[i] ^ s_key[i]);
}
Console.WriteLine(s_result);

}
}
}

posted on 2017-09-11 19:33  YuJiaJia  阅读(177)  评论(0编辑  收藏  举报

导航