stack input and general function

function for input and arr size decleration.