Answers for "how to take input in an array"

1

take array input

arr = list(map(int, input().split()))
Posted by: Guest on August-08-2020
0

array input

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String  lines = br.readLine();    
        
    String[] strs = lines.trim().split("\s+");
            
    for (int i = 0; i < strs.length; i++) {
    a[i] = Integer.parseInt(strs[i]);
    }
Posted by: Guest on June-14-2021

Code answers related to "how to take input in an array"

Python Answers by Framework

Browse Popular Code Answers by Language