输入一个五位数,把这个位数单独的分成阿拉伯数字,并且把这五个数字用四个空格彼此分开逆顺序输出,例如用户输入31455,则输出5 5 4 1 3
代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 运算符
{
class Program
{
static void Main(string[] args)
{
Console.Write("请输入五位的阿拉伯数字:");
string shuzi = Console.ReadLine();
int int_x = Convert.ToInt32(shuzi);
int int_a = int_x / 10000;
int int_b = int_x %10000 / 1000;
int int_c = int_x % 10000 % 1000/100;
int int_d = int_x % 10000 % 1000%100/10;
int int_e = int_x % 10;
Console.WriteLine("{0} {1} {2} {3} {4}",int_e ,int_d, int_c ,int_b ,int_a );
Console.ReadLine();
}
}
}