Help with codes

the bookstore <DS1307RTC.h> The following code does not work

RTC.get(rtc,true);
for (int i = 0; i <7; i ++)

which the valid code

There are many libraries for the DS1307, can you tell which one you are using (just copy a link to it in your post).
Do you have trouble compiling it or does the sketch not show the time ?

If it is a wiring problem, you might try the i2c_scanner : Arduino Playground - I2cScanner
The scanner should detect the DS1307. If it doesn't, the wiring is wrong, and you could attach a photo so we can check the wiring.