1.昨天做C#练习题时,有个if(){},写条件时,“==”写成“=”;
2.题目:编写一个应用程序用来输入的字符串进行加密,对于字母字符串加密规则如下:
‘a’→’d’ ‘b’→’e’ ‘w’→’z’ ……
‘x’→’a’ ‘y’→’b’ ‘z’→’c’
‘A’→’D’ ‘B’→’E’ ‘W’→’Z’ ……
‘X’→’A’ ‘Y’→’B’ ‘Z’→’C’?
对于其他字符,不进行加密。
namespace _152
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("输入字符串,进行加密:");
string strOld = Console.ReadLine();
string strTemp = "";
for (int i = 0; i < strOld.Length; i++)
{
//Array[] strNew = new Array[strOld.Length];//不用数组,用上面的字符串strTtemp
if (strOld[i] >= 'a' && strOld[i] <= 'w')
{
//int num = C