import sys
def func():
T = int(next(sys.stdin))
for i in range(0,T):
N = int(next(sys.stdin))
print (N)
func()
Here I am taking input T for for loop and iterating over T it gives Runtime error time: 0.1 memory: 10088 signal:-1
again-again . I have tried using sys.stdin.readline()
it also giving same error .
I looked at your code at http://ideone.com/8U5zTQ . at the code itself looks fine, but your input can't be processed.
Because it is:
which will be the string:
this is not nearly an int, even if you try to cast it. So you could transform it to the a list with:
to get the integers in a list that you are putting in one line. The loop over that.
After that the code would still be in loop because it want 2 integers more but at least you get some output.
Since I am not totally shure what you try to achieve, you could now iterate over that list and print your inputs:
Another solution would be, you just put one number per line in, that would work also
so instead of
you put in
Further Advice
on Ideone you also have an Error Traceback at the bottom auf the page:
which showed you that it can't handle your input