#160
Să se insereze într-un șir înaintea fiecărui element pătrat perfect rădăcina sa pătrată.
| Problema | inserareInainte | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64078015 | Utilizator | |
| Fișier | inserareinainte.cpp | Dimensiune | 913 B |
| Data încărcării | 15 Aprilie 2026, 21:18 | Scor/rezultat | Eroare de compilare |
inserareinainte.cpp:16:2: error: stray ‘#’ in program 16 | }#include <iostream> | ^ inserareinainte.cpp:16:3: error: ‘include’ does not name a type 16 | }#include <iostream> | ^~~~~~~ In file included from inserareinainte.cpp:17: /usr/include/c++/13/cmath:85:11: error: ‘acos’ has not been declared in ‘::’ 85 | using ::acos; | ^~~~ /usr/include/c++/13/cmath:104:11: error: ‘asin’ has not been declared in ‘::’ 104 | using ::asin; | ^~~~ /usr/include/c++/13/cmath:123:11: error: ‘atan’ has not been declared in ‘::’ 123 | using ::atan; | ^~~~ /usr/include/c++/13/cmath:142:11: error: ‘atan2’ has not been declared in ‘::’ 142 | using ::atan2; | ^~~~~ /usr/include/c++/13/cmath:154:11: error: ‘ceil’ has not been declared in ‘::’ 154 | using ::ceil; | ^~~~ /usr/include/c++/13/cmath:173:11: error: ‘cos’ has not been declared in ‘::’ 173 | using ::cos; | ^~~ /usr/include/c++/13/cmath:192:11: error: ‘cosh’ has not been declared in ‘::’ 192 | using ::cosh; | ^~~~ /usr/include/c++/13/cmath:211:11: error: ‘exp’ has not been declared in ‘::’ 211 | using ::exp; | ^~~ /usr/include/c++/13/cmath:230:11: error: ‘fabs’ has not been declared in ‘::’ 230 | using ::fabs; | ^~~~ /usr/include/c++/13/cmath:249:11: error: ‘floor’ has not been declared in ‘::’ 249 | using ::floor; | ^~~~~ /usr/include/c++/13/cmath:268:11: error: ‘fmod’ has not been declared in ‘::’ 268 | using ::fmod; | ^~~~ /usr/include/c++/13/cmath:280:11: error: ‘frexp’ has not been declared in ‘::’ 280 | using ::frexp; | ^~~~~ /usr/include/c++/13/cmath:299:11: error: ‘ldexp’ has not been declared in ‘::’ 299 | using ::ldexp; | ^~~~~ /usr/include/c++/13/cmath:318:11: error: ‘log’ has not been declared in ‘::’ 318 | using ::log; | ^~~ /usr/include/c++/13/cmath:337:11: error: ‘log10’ has not been declared in ‘::’ 337 | using ::log10; | ^~~~~ /usr/include/c++/13/cmath:356:11: error: ‘modf’ has not been declared in ‘::’ 356 | using ::modf; | ^~~~ /usr/include/c++/13/cmath:368:11: error: ‘pow’ has not been declared in ‘::’ 368 | using ::pow; | ^~~ /usr/include/c++/13/cmath:396:11: error: ‘sin’ has not been declared in ‘::’ 396 | using ::sin; | ^~~ /usr/include/c++/13/cmath:415:11: error: ‘sinh’ has not been declared in ‘::’ 415 | using ::sinh; | ^~~~ /usr/include/c++/13/cmath:434:11: error: ‘sqrt’ has not been declared in ‘::’ 434 | using ::sqrt; | ^~~~ /usr/include/c++/13/cmath:453:11: error: ‘tan’ has not been declared in ‘::’ 453 | using ::tan; | ^~~ /usr/include/c++/13/cmath:472:11: error: ‘tanh’ has not been declared in ‘::’ 472 | using ::tanh; | ^~~~ /usr/include/c++/13/cmath:1881:11: error: ‘double_t’ has not been declared in ‘::’ 1881 | using ::double_t; | ^~~~~~~~ /usr/include/c++/13/cmath:1882:11: error: ‘float_t’ has not been declared in ‘::’ 1882 | using ::float_t; | ^~~~~~~ /usr/include/c++/13/cmath:1885:11: error: ‘acosh’ has not been declared in ‘::’ 1885 | using ::acosh; | ^~~~~ /usr/include/c++/13/cmath:1886:11: error: ‘acoshf’ has not been declared in ‘::’ 1886 | using ::acoshf; | ^~~~~~ /usr/include/c++/13/cmath:1887:11: error: ‘acoshl’ has not been declared in ‘::’ 1887 | using ::acoshl; | ^~~~~~ /usr/include/c++/13/cmath:1889:11: error: ‘asinh’ has not been declared in ‘::’ 1889 | using ::asinh; | ^~~~~ /usr/include/c++/13/cmath:1890:11: error: ‘asinhf’ has not been declared in ‘::’ 1890 | using ::asinhf; | ^~~~~~ /usr/include/c++/13/cmath:1891:11: error: ‘asinhl’ has not been declared in ‘::’ 1891 | using ::asinhl; | ^~~~~~ /usr/include/c++/13/cmath:1893:11: error: ‘atanh’ has not been declared in ‘::’ 1893 | using ::atanh; | ^~~~~ /usr/include/c++/13/cmath:1894:11: error: ‘atanhf’ has not been declared in ‘::’ 1894 | using ::atanhf; | ^~~~~~ /usr/include/c++/13/cmath:1895:11: error: ‘atanhl’ has not been declared in ‘::’ 1895 | using ::atanhl; | ^~~~~~ /usr/include/c++/13/cmath:1897:11: error: ‘cbrt’ has not been declared in ‘::’ 1897 | using ::cbrt; | ^~~~ /usr/include/c++/13/cmath:1898:11: error: ‘cbrtf’ has not been declared in ‘::’ 1898 | using ::cbrtf; | ^~~~~ /usr/include/c++/13/cmath:1899:11: error: ‘cbrtl’ has not been declared in ‘::’ 1899 | using ::cbrtl; | ^~~~~ /usr/include/c++/13/cmath:1901:11: error: ‘copysign’ has not been declared in ‘::’ 1901 | using ::copysign; | ^~~~~~~~ /usr/include/c++/13/cmath:1902:11: error: ‘copysignf’ has not been declared in ‘::’ 1902 | using ::copysignf; | ^~~~~~~~~ /usr/include/c++/13/cmath:1903:11: error: ‘copysignl’ has not been declared in ‘::’ 1903 | using ::copysignl; | ^~~~~~~~~ /usr/include/c++/13/cmath:1905:11: error: ‘erf’ has not been declared in ‘::’ 1905 | using ::erf; | ^~~ /usr/include/c++/13/cmath:1906:11: error: ‘erff’ has not been declared in ‘::’ 1906 | using ::erff; | ^~~~ /usr/include/c++/13/cmath:1907:11: error: ‘erfl’ has not been declared in ‘::’ 1907 | using ::erfl; | ^~~~ /usr/include/c++/13/cmath:1909:11: error: ‘erfc’ has not been declared in ‘::’ 1909 | using ::erfc; | ^~~~ /usr/include/c++/13/cmath:1910:11: error: ‘erfcf’ has not been declared in ‘::’ 1910 | using ::erfcf; | ^~~~~ /usr/include/c++/13/cmath:1911:11: error: ‘erfcl’ has not been declared in ‘::’ 1911 | using ::erfcl; | ^~~~~ /usr/include/c++/13/cmath:1913:11: error: ‘exp2’ has not been declared in ‘::’ 1913 | using ::exp2; | ^~~~ /usr/include/c++/13/cmath:1914:11: error: ‘exp2f’ has not been declared in ‘::’ 1914 | using ::exp2f; | ^~~~~ /usr/include/c++/13/cmath:1915:11: error: ‘exp2l’ has not been declared in ‘::’ 1915 | using ::exp2l; | ^~~~~ /usr/include/c++/13/cmath:1917:11: error: ‘expm1’ has not been declared in ‘::’ 1917 | using ::expm1; | ^~~~~ /usr/include/c++/13/cmath:1918:11: error: ‘expm1f’ has not been declared in ‘::’ 1918 | using ::expm1f; | ^~~~~~ /usr/include/c++/13/cmath:1919:11: error: ‘expm1l’ has not been declared in ‘::’ 1919 | using ::expm1l; | ^~~~~~ /usr/include/c++/13/cmath:1921:11: error: ‘fdim’ has not been declared in ‘::’ 1921 | using ::fdim; | ^~~~ /usr/include/c++/13/cmath:1922:11: error: ‘fdimf’ has not been declared in ‘::’ 1922 | using ::fdimf; | ^~~~~ /usr/include/c++/13/cmath:1923:11: error: ‘fdiml’ has not been declared in ‘::’ 1923 | using ::fdiml; | ^~~~~ /usr/include/c++/13/cmath:1925:11: error: ‘fma’ has not been declared in ‘::’ 1925 | using ::fma; | ^~~ /usr/include/c++/13/cmath:1926:11: error: ‘fmaf’ has not been declared in ‘::’ 1926 | using ::fmaf; | ^~~~ /usr/include/c++/13/cmath:1927:11: error: ‘fmal’ has not been declared in ‘::’ 1927 | using ::fmal; | ^~~~ /usr/include/c++/13/cmath:1929:11: error: ‘fmax’ has not been declared in ‘::’ 1929 | using ::fmax; | ^~~~ /usr/include/c++/13/cmath:1930:11: error: ‘fmaxf’ has not been declared in ‘::’ 1930 | using ::fmaxf; | ^~~~~ /usr/include/c++/13/cmath:1931:11: error: ‘fmaxl’ has not been declared in ‘::’ 1931 | using ::fmaxl; | ^~~~~ /usr/include/c++/13/cmath:1933:11: error: ‘fmin’ has not been declared in ‘::’ 1933 | using ::fmin; | ^~~~ /usr/include/c++/13/cmath:1934:11: error: ‘fminf’ has not been declared in ‘::’ 1934 | using ::fminf; | ^~~~~ /usr/include/c++/13/cmath:1935:11: error: ‘fminl’ has not been declared in ‘::’ 1935 | using ::fminl; | ^~~~~ /usr/include/c++/13/cmath:1937:11: error: ‘hypot’ has not been declared in ‘::’ 1937 | using ::hypot; | ^~~~~ /usr/include/c++/13/cmath:1938:11: error: ‘hypotf’ has not been declared in ‘::’ 1938 | using ::hypotf; | ^~~~~~ /usr/include/c++/13/cmath:1939:11: error: ‘hypotl’ has not been declared in ‘::’ 1939 | using ::hypotl; | ^~~~~~ /usr/include/c++/13/cmath:1941:11: error: ‘ilogb’ has not been declared in ‘::’ 1941 | using ::ilogb; | ^~~~~ /usr/include/c++/13/cmath:1942:11: error: ‘ilogbf’ has not been declared in ‘::’ 1942 | using ::ilogbf; | ^~~~~~ /usr/include/c++/13/cmath:1943:11: error: ‘ilogbl’ has not been declared in ‘::’ 1943 | using ::ilogbl; | ^~~~~~ /usr/include/c++/13/cmath:1945:11: error: ‘lgamma’ has not been declared in ‘::’ 1945 | using ::lgamma; | ^~~~~~ /usr/include/c++/13/cmath:1946:11: error: ‘lgammaf’ has not been declared in ‘::’ 1946 | using ::lgammaf; | ^~~~~~~ /usr/include/c++/13/cmath:1947:11: error: ‘lgammal’ has not been declared in ‘::’ 1947 | using ::lgammal; | ^~~~~~~ /usr/include/c++/13/cmath:1950:11: error: ‘llrint’ has not been declared in ‘::’ 1950 | using ::llrint; | ^~~~~~ /usr/include/c++/13/cmath:1951:11: error: ‘llrintf’ has not been declared in ‘::’ 1951 | using ::llrintf; | ^~~~~~~ /usr/include/c++/13/cmath:1952:11: error: ‘llrintl’ has not been declared in ‘::’ 1952 | using ::llrintl; | ^~~~~~~ /usr/include/c++/13/cmath:1954:11: error: ‘llround’ has not been declared in ‘::’ 1954 | using ::llround; | ^~~~~~~ /usr/include/c++/13/cmath:1955:11: error: ‘llroundf’ has not been declared in ‘::’ 1955 | using ::llroundf; | ^~~~~~~~ /usr/include/c++/13/cmath:1956:11: error: ‘llroundl’ has not been declared in ‘::’ 1956 | using ::llroundl; | ^~~~~~~~ /usr/include/c++/13/cmath:1959:11: error: ‘log1p’ has not been declared in ‘::’ 1959 | using ::log1p; | ^~~~~ /usr/include/c++/13/cmath:1960:11: error: ‘log1pf’ has not been declared in ‘::’ 1960 | using ::log1pf; | ^~~~~~ /usr/include/c++/13/cmath:1961:11: error: ‘log1pl’ has not been declared in ‘::’ 1961 | using ::log1pl; | ^~~~~~ /usr/include/c++/13/cmath:1963:11: error: ‘log2’ has not been declared in ‘::’ 1963 | using ::log2; | ^~~~ /usr/include/c++/13/cmath:1964:11: error: ‘log2f’ has not been declared in ‘::’ 1964 | using ::log2f; | ^~~~~ /usr/include/c++/13/cmath:1965:11: error: ‘log2l’ has not been declared in ‘::’ 1965 | using ::log2l; | ^~~~~ /usr/include/c++/13/cmath:1967:11: error: ‘logb’ has not been declared in ‘::’ 1967 | using ::logb; | ^~~~ /usr/include/c++/13/cmath:1968:11: error: ‘logbf’ has not been declared in ‘::’ 1968 | using ::logbf; | ^~~~~ /usr/include/c++/13/cmath:1969:11: error: ‘logbl’ has not been declared in ‘::’ 1969 | using ::logbl; | ^~~~~ /usr/include/c++/13/cmath:1971:11: error: ‘lrint’ has not been declared in ‘::’ 1971 | using ::lrint; | ^~~~~ /usr/include/c++/13/cmath:1972:11: error: ‘lrintf’ has not been declared in ‘::’ 1972 | using ::lrintf; | ^~~~~~ /usr/include/c++/13/cmath:1973:11: error: ‘lrintl’ has not been declared in ‘::’ 1973 | using ::lrintl; | ^~~~~~ /usr/include/c++/13/cmath:1975:11: error: ‘lround’ has not been declared in ‘::’ 1975 | using ::lround; | ^~~~~~ /usr/include/c++/13/cmath:1976:11: error: ‘lroundf’ has not been declared in ‘::’ 1976 | using ::lroundf; | ^~~~~~~ /usr/include/c++/13/cmath:1977:11: error: ‘lroundl’ has not been declared in ‘::’ 1977 | using ::lroundl; | ^~~~~~~ /usr/include/c++/13/cmath:1979:11: error: ‘nan’ has not been declared in ‘::’ 1979 | using ::nan; | ^~~ /usr/include/c++/13/cmath:1980:11: error: ‘nanf’ has not been declared in ‘::’ 1980 | using ::nanf; | ^~~~ /usr/include/c++/13/cmath:1981:11: error: ‘nanl’ has not been declared in ‘::’ 1981 | using ::nanl; | ^~~~ /usr/include/c++/13/cmath:1983:11: error: ‘nearbyint’ has not been declared in ‘::’ 1983 | using ::nearbyint; | ^~~~~~~~~ /usr/include/c++/13/cmath:1984:11: error: ‘nearbyintf’ has not been declared in ‘::’ 1984 | using ::nearbyintf; | ^~~~~~~~~~ /usr/include/c++/13/cmath:1985:11: error: ‘nearbyintl’ has not been declared in ‘::’ 1985 | using ::nearbyintl; | ^~~~~~~~~~ /usr/include/c++/13/cmath:1987:11: error: ‘nextafter’ has not been declared in ‘::’ 1987 | using ::nextafter; | ^~~~~~~~~ /usr/include/c++/13/cmath:1988:11: error: ‘nextafterf’ has not been declared in ‘::’ 1988 | using ::nextafterf; | ^~~~~~~~~~ /usr/include/c++/13/cmath:1989:11: error: ‘nextafterl’ has not been declared in ‘::’ 1989 | using ::nextafterl; | ^~~~~~~~~~ /usr/include/c++/13/cmath:1991:11: error: ‘nexttoward’ has not been declared in ‘::’ 1991 | using ::nexttoward; | ^~~~~~~~~~ /usr/include/c++/13/cmath:1992:11: error: ‘nexttowardf’ has not been declared in ‘::’ 1992 | using ::nexttowardf; | ^~~~~~~~~~~ /usr/include/c++/13/cmath:1993:11: error: ‘nexttowardl’ has not been declared in ‘::’ 1993 | using ::nexttowardl; | ^~~~~~~~~~~ /usr/include/c++/13/cmath:1995:11: error: ‘remainder’ has not been declared in ‘::’ 1995 | using ::remainder; | ^~~~~~~~~ /usr/include/c++/13/cmath:1996:11: error: ‘remainderf’ has not been declared in ‘::’ 1996 | using ::remainderf; | ^~~~~~~~~~ /usr/include/c++/13/cmath:1997:11: error: ‘remainderl’ has not been declared in ‘::’ 1997 | using ::remainderl; | ^~~~~~~~~~ /usr/include/c++/13/cmath:1999:11: error: ‘remquo’ has not been declared in ‘::’ 1999 | using ::remquo; | ^~~~~~ /usr/include/c++/13/cmath:2000:11: error: ‘remquof’ has not been declared in ‘::’ 2000 | using ::remquof; | ^~~~~~~ /usr/include/c++/13/cmath:2001:11: error: ‘remquol’ has not been declared in ‘::’ 2001 | using ::remquol; | ^~~~~~~ /usr/include/c++/13/cmath:2003:11: error: ‘rint’ has not been declared in ‘::’ 2003 | using ::rint; | ^~~~ /usr/include/c++/13/cmath:2004:11: error: ‘rintf’ has not been declared in ‘::’ 2004 | using ::rintf; | ^~~~~ /usr/include/c++/13/cmath:2005:11: error: ‘rintl’ has not been declared in ‘::’ 2005 | using ::rintl; | ^~~~~ /usr/include/c++/13/cmath:2007:11: error: ‘round’ has not been declared in ‘::’ 2007 | using ::round; | ^~~~~ /usr/include/c++/13/cmath:2008:11: error: ‘roundf’ has not been declared in ‘::’ 2008 | using ::roundf; | ^~~~~~ /usr/include/c++/13/cmath:2009:11: error: ‘roundl’ has not been declared in ‘::’ 2009 | using ::roundl; | ^~~~~~ /usr/include/c++/13/cmath:2011:11: error: ‘scalbln’ has not been declared in ‘::’ 2011 | using ::scalbln; | ^~~~~~~ /usr/include/c++/13/cmath:2012:11: error: ‘scalblnf’ has not been declared in ‘::’ 2012 | using ::scalblnf; | ^~~~~~~~ /usr/include/c++/13/cmath:2013:11: error: ‘scalblnl’ has not been declared in ‘::’ 2013 | using ::scalblnl; | ^~~~~~~~ /usr/include/c++/13/cmath:2015:11: error: ‘scalbn’ has not been declared in ‘::’ 2015 | using ::scalbn; | ^~~~~~ /usr/include/c++/13/cmath:2016:11: error: ‘scalbnf’ has not been declared in ‘::’ 2016 | using ::scalbnf; | ^~~~~~~ /usr/include/c++/13/cmath:2017:11: error: ‘scalbnl’ has not been declared in ‘::’ 2017 | using ::scalbnl; | ^~~~~~~ /usr/include/c++/13/cmath:2019:11: error: ‘tgamma’ has not been declared in ‘::’ 2019 | using ::tgamma; | ^~~~~~ /usr/include/c++/13/cmath:2020:11: error: ‘tgammaf’ has not been declared in ‘::’ 2020 | using ::tgammaf; | ^~~~~~~ /usr/include/c++/13/cmath:2021:11: error: ‘tgammal’ has not been declared in ‘::’ 2021 | using ::tgammal; | ^~~~~~~ /usr/include/c++/13/cmath:2023:11: error: ‘trunc’ has not been declared in ‘::’ 2023 | using ::trunc; | ^~~~~ /usr/include/c++/13/cmath:2024:11: error: ‘truncf’ has not been declared in ‘::’ 2024 | using ::truncf; | ^~~~~~ /usr/include/c++/13/cmath:2025:11: error: ‘truncl’ has not been declared in ‘::’ 2025 | using ::truncl; | ^~~~~~ inserareinainte.cpp:21:5: error: redefinition of ‘int main()’ 21 | int main() | ^~~~ inserareinainte.cpp:11:5: note: ‘int main()’ previously defined here 11 | int main() | ^~~~ inserareinainte.cpp: In function ‘int main()’: inserareinainte.cpp:32:17: error: ‘j’ was not declared in this scope 32 | for(j=n;j>=i;j--) | ^ inserareinainte.cpp:23:19: warning: unused variable ‘p’ [-Wunused-variable] 23 | int n,v[52],i,p,r; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema inserareInainte face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.