Within the Hubbard model with strong Coulomb interaction U ≫ t (the t-J model), the possibility is studied for the superconducting state to exist due to charge and spin fluctuations in a system. Within the generalized random phase approximation (GRPA) used earlier by the authors for the calculation of magnetic susceptibility, the effective interaction between electrons in the Cooper channel was calculated. The calculations were performed by the diagram technique for the Hubbard operators. In GRPA, the effective interaction takes into account all diagram sequences with fermion loops and spin Green functions. The effective interaction is expressed via dynamical magnetic and dielectric susceptibilities; therefore it is considerably enhanced near the boundaries of the paramagnetic phase's instability towards the appearance of magnetic order, or of a state with charge density wave. Equations for the strong coupling in a superconductor are derived for the normal Z and anomalous φ parts of the electron Green function, linearized in the order parameter φ. The superconducting transition temperature T c is calculated with various sets of parameters in the (t/U, n) plane, n being the electron concentration. It is shown that in the itinerant magnetism regime (n < nc), where there is no localized magnetic moments in the system, spin fluctuations in the vicinity of antiferromagnetic phase transition lead to electron coupling with d-type symmetry, in analogy to the case of weak Coulomb repulsion. In the localized magnetic moment regime (n > nc), a quasistatistical term appears in the magnetic susceptibility. This terms leads to the pair-breaking mechanism, acting analogously to magnetic impurities. The dynamical part of the susceptibility may result in pairing interaction; however, high values of T c can hardly be expected in this case because of the pair-breaking interaction with localized magnetic moments. In the "Hubbard 1" approximation, the critical concentration nc for band with symmetric density of states equals 2/3. For n > 0.88, CDW instability appears in the system. Near its boundary, charge fluctuations may lead to coupling interaction with trivial symmetry of the order parameter. However, the critical line of the CDW instability lies within the region of ferromagnetic phase, and superconductivity becomes suppressed due to spin splitting of the electron spectrum.