第1个回答 2011-02-25
string num = 56666;
string[] numArray = new String[num.length);
for(int i = 0; i < num.length;i++)
{
if(i==num.length -1)
{
break;
}
numArray[i] = num.substring(i,i+1);
}
for(int i = 0;i< numArray.length;i++)
{
tb.Text = "第"+(i+1)+"位的数值为:"+numArray[i].Tostring();
}
基本思路就是这个样子了!剩下的慢慢的来琢磨吧!
第2个回答 2011-02-24
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < textBox1.Text.Length; i++)
{
listBox1.Items.Add(string.Format("第{0}位的值为:{1}", i + 1, textBox1.Text[i]));
}
}
}
}
需要完整程序的话,留下邮箱,我打包发给你