This code expects the file Rainfall.txt to be in the same directory as the running executable. Is it? That is almost certainly not the same place as your "project" files.
Well i made a different project with the same input file and did the same format to read it in like that and it worked, now i am editing that file so I thought it would still work but for some reason this does not work.