3 回答

TA貢獻(xiàn)1934條經(jīng)驗(yàn) 獲得超2個(gè)贊
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace wordGame
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string iuputString = Convert.ToString(textBox1.Text);
string outputString = null;
char ch = '\0';
for (int i = 0; i <= iuputString.Length - 1; i++)
{
if (ch == 'A' || ch == 'a' ||
ch == 'E' || ch == 'e' ||
ch == 'I' || ch == 'i' ||
ch == 'O' || ch == 'o' ||
ch == 'U' || ch == 'u')
{
outputString += "Egg";
outputString += ch.ToString();
}
else
{
ch = 'C';
outputString += ch.ToString();
}
}
textBox2.Text = outputString;
}
}
}
修改后才可以正常!

TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超4個(gè)贊
textBox2.Text =outputString;
}
}
去掉一個(gè)}
textBox2.Text =outputString;
}

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超8個(gè)贊
inputstring 打錯(cuò)啦;
inputString = new String(textBox1.Text.ToCharArray());//
- 3 回答
- 0 關(guān)注
- 264 瀏覽
添加回答
舉報(bào)