Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // receive as input a string of length 16, actually receives 16 digits
- // then send each digit to a new array where each digit is a int element
- public class test2 {
- public static void main(String args[]) {
- int arr[] = new int[16];
- String n = "1234567891111113";
- for(int x=0; x<n.length(); x++) {
- arr[x] = Integer.parseInt(n.substring(x,x+1));
- }
- for(int a: arr) {
- System.out.print(a + "-"); }
- System.out.println();
- }
- }
Add Comment
Please, Sign In to add comment