cin is replaced by scanf