like there in question it is given that to take input by a line containing three no. with space sepereated
Um, I might be misinterpreting the question but if you’re asking how to take input of 3 numbers in a line separated by space like
2 3 4
Then something like
a,b,c = map(int, input().split()) should do the trick?
In Java :
Scanner sc = new Scanner(System.in); String n = sc.nextLine().split(" "); int a= Integer.parseInt(n); int b=Integer.parseInt(n); int c=Integer.parseInt(n);
Use Google .
for example there might be 1000 or 100000 integers in a line seperated by space then i need to take input in a array so can you tell the code for this
arr = list(map(int, input().split())) should do it. Don’t need the size.
However if you wanna use CPP,
while(cin >> n)