formatted input from standard input similar to scanf from C
