The ocean is salty because the rain physically erodes the rock and the acids chemically break down the rocks and carries salts and minerals along in a dissolved state as ions. The ions in the runoff are carried to the streams and rivers and to the ocean.
Though rivers are fresh water down to the ocean what more if it does not flow, the ocean would be really salty.
The salinity factors are continually counterbalanced by processes that decrease salinity such as the continuous input of fresh water from rivers, precipitation of rain and snow, and melting of ice.