# Thread: Separating the digits of given number

1. Member
Join Date
Sep 2010
Posts
2
Rep Power
0

## Separating the digits of given number

Hi everyone,
I am trying to write a program which inputs one number consisting of five digits, then that number is being separated into individual digits separated each by (for example) 5 positions and prints out the newly separated number. For instance, if the user types in 12345 the program displays 1 2 3 4 5.
I am using java.util.Scanner but the tricky part is the separating of the actual digits.
Any ideas are greatly appreciated.

LB

P.S. The number is typed in by the user using Scanner class.
Last edited by lb2; 09-09-2010 at 05:00 AM.

2. Senior Member
Join Date
May 2010
Posts
436
Rep Power
4
Originally Posted by lb2
Hi everyone,
I am trying to write a program which inputs one number consisting of five digits, then that number is being separated into individual digits separated each by (for example) 5 positions and prints out the newly separated number. For instance, if the user types in 12345 the program displays 1 2 3 4 5.
I am using java.util.Scanner but the tricky part is the separating of the actual digits.
Any ideas are greatly appreciated.

LB

P.S. The number is typed in by the user using Scanner class.
Are you going to tell the volunteers here that you've already asked this question elsewhere? New To Java - Separating digits of given number That you've already received decent instruction on what to do? Or do you not care if they waste time duplicating work that's already been done?

3. Member
Join Date
Sep 2010
Posts
2
Rep Power
0
Hmm. I guess that same topic in the other forum is posted by my buddy :) We are in the same class and probably working on the same problem at the same time.
I am sorry for this kind of double posting. Please, disregard this post everyone. I am going to check the other forum.

4. Senior Member
Join Date
May 2010
Posts
436
Rep Power
4
Originally Posted by lb2
Hmm. I guess that same topic in the other forum is posted by my buddy :) We are in the same class and probably working on the same problem at the same time.
I am sorry for this kind of double posting. Please, disregard this post everyone. I am going to check the other forum.
It's an amazing coincidence that your question and your "buddy's" are exactly the same. I mean word-for-word. What do you take us for?

5. Originally Posted by curmudgeon
It's an amazing coincidence that your question and your "buddy's" are exactly the same. I mean word-for-word. What do you take us for?
Amazing ha. Could be cross-posting.

6. Senior Member
Join Date
May 2010
Posts
436
Rep Power
4
Originally Posted by Eranga
Amazing ha. Could be cross-posting.
Yep, that's my conclusion, that it's likely the same guy cross-posting.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•