using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace shiyan4_1
{
class Program
{
static void Main(string[] args)
{
string str1, str2;
int count = 0;
str1=Console.ReadLine();
count = MyClass.GetNumber(str1, out str2);
Console.WriteLine("数字的个数是:{0},所有的字符数组是:{1}",count,str2);
Console.ReadKey();
}
}
class MyClass
{
public static int GetNumber(string strSource, out string result)
{
int count=0,j=0;
result = "";
char[] ch1 = new char[1000];
char[] ch2 = new char[1000];
ch1 = strSource.ToCharArray();
for (int i = 0; i < strSource.Length; i++)
{
if (ch1[i] >= 48 && ch1[i] <= 57)
{
ch2[j++] = ch1[i];
count++;
}
}
for (int i = 0; i < count; i++)
{
result += ch2[i].ToString();
}
return count;
}
}
}