帮个忙啊俺不会啊加油

img


          Console.WriteLine("请输入一串字符");
            string str = Console.ReadLine();
            string result = "";
            for(int i=0;i<str.Length;i++)
            {
                string tempStr;
                if (i % 2 == 0)
                {
                    if (char.IsLower(str[i]))
                    {
                        tempStr = str[i].ToString().ToUpper();
                    }else if(char.IsUpper(str[i]))
                    {
                        tempStr = str[i].ToString().ToLower();
                    }else if(char.IsNumber(str[i]))
                    {
                        tempStr = "\r\n";
                    }
                    else
                    {
                        tempStr = "1";
                    }
                }else
                {
                    tempStr = str[i].ToString();
                }
                result += tempStr;
            }
            Console.WriteLine($"编译结果为{result}");