using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Collections;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("输入由字母和数字组成的字符串:");
String x = Console.ReadLine();
char[] chars = x.ToCharArray();
int int_Indexof = 0;
Array.ForEach(chars, z =>
{
if (Char.IsDigit(z))
{
Console.WriteLine("数字:" + z + ",位置:" + int_Indexof);
}
int_Indexof++;
});
}
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载