Operations on modulo operator%

Source: Internet
Author: User

Enter a five-digit number, divide this number separately into Arabic numerals, and the five numbers with four spaces separated from each other in reverse order output, such as user input 31455, then output 5 5 4 1 3

The code is as follows:


Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;

namespace operator
{
Class Program
{

static void Main (string[] args)
{
Console.Write ("Please enter five digits of Arabic numerals:");
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 ();

}
}
}

Operations on modulo operator%

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.