In your haste to come in and ask a question, you seem to have missed reading our policy on display names, which quite clearly states that you must use a real (sounding) first and last name for your display name -- no joke names, "handles," or last initials are acceptable. You can fix your display name here. Thanks for your cooperation!
Regarding your problem: when you define the variable "str", you initialize it to point to the first line read from the file; then you never use that string, but immediately read and process the next seven lines. It looks as though the program would work more or less correctly if you simply didn't call "readline" when declaring "str".