What the sharp or flat signs mean is that in that particular key, the notes that will be written in that line or space will be played as sharps or flats. For example, there are no sharps or flats in C major, therefore no designations at the beginning of the score.
However, let's move up one fifth, to G Major. In G Major, there is one sharped note, F#, so at the beginning of a piece written in G Major, there will be a sharp sign on the F line of the staff. Moving up one more fifth, to the key of D Major, there are two sharps, F# and C#. So, a score in D Major will have sharp signs on the F line and in the C space at the beginning.
This is done so the composer does not have to write in the sharp or flat sign every time that note is played in the piece. It is up to the musician to remember that in the key they are in, all those notes will be played sharp or flat UNLESS otherwise designated as a natural.
Out of the loop? I didn't know there was a loop!