编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛  
 
全能 ASP / PHP / ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付学习型 ASP/PHP/ASP.NET 主机 30元/年
发新话题
打印

C#编程题(用户输入31245,则输出5 4 2 1 3。)

C#编程题(用户输入31245,则输出5 4 2 1 3。)

编写一个应用程序,输入一个五位数,把这五个数分成单独的阿拉伯数字,并且把这五个数字用四个空格彼此分开逆序输出。
例如用户输入31245,则输出5 4 2 1 3。
static void Main(string[] args)
{
//
// TODO: 在此处添加代码以启动应用程序
//
//int a;
//int p;
int i;
string strInputNum;
int intInputNum;
int[] arrayInt;
arrayInt = new int[5];
Console.WriteLine("请输入上述的几个数:");
for(i=0;i<arrayInt.Length;i++)
{
strInputNum=Console.ReadLine().Trim();
intInputNum=Convert.ToInt16(strInputNum);
arrayInt[i]=intInputNum;
}
//for(i=0;i<arrayInt.Length;i++)
//{
// Console.WriteLine(arrayInt[i]);
//}
for(i=arrayInt.Length-1;i>=0;i--)
{
Console.WriteLine(arrayInt[i]);
}
}

TOP

天下风云出我,辈一入江湖岁月催.皇途霸业谈笑中,不盛人生

TOP

你是想问啥?

我的msn: myfend@hotmail.com

TOP

我想他是想问,倒输出问题.
Repeat  Life=Study;Until (death);        //<a href="http://hi.baidu.com/yzidan" target="_blank"><font color="green">***>[B]欢 迎 光 临 我 的 博 客[/B]

TOP

他的程序没错的.
我的msn: myfend@hotmail.com

TOP

。。。。。第三贴。。```

TOP

以下是引用purana在2007-9-30 18:02:30的发言:
他的程序没错的.

他可能是要努力灌水,争当合格坛民吧

Repeat  Life=Study;Until (death);        //<a href="http://hi.baidu.com/yzidan" target="_blank"><font color="green">***>[B]欢 迎 光 临 我 的 博 客[/B]

TOP

发新话题