c#字母加密

/*
 * 由SharpDevelop创建。
 * 用户: Administrator
 * 日期: 2018/10/14
 * 时间: 21:07
 * 
 * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
 */
using System;

namespace clianxi3
{
	class Program
	{
		public static void Main(string[] args)
		{ 
			string str=Console .ReadLine ();
			string temr1="";
			for (int i = 0; i <str .Length; i++){//便利每一个字符
				if (str [i]>='a'&&str[i]<='z') {
					int num=str[i];
					num+=3;
					char temp=(char)num;
					temp=(char)(temp-'z'+'a'-1);
					temr1+=temp;
			}else if (str [i]>='A'&&str[i]<='Z') {
				int num=str[i];
					num+=3;
					char temp=(char)num;
					if (temp>'Z') {
						temp=(char)(temp-'Z'+'A'-1);
					}
					temr1+=temp;
				}else{
					temr1+=str[i];
				}
				
			}
			Console.WriteLine(temr1);
			
			// TODO: Implement Functionality Here
			
			Console.Write("Press any key to continue . . . ");
			Console.ReadKey(true);
		}
	}
}
原文地址:https://www.cnblogs.com/llhhcc/p/9795081.html