#2948
medie_patratica
Se dau n
numere naturale. Calculați media pătratică a celor n
numere citite cu 2
zecimale exacte.
Problema | medie_patratica | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53643480 | Utilizator | |
Fișier | medie_patratica.cpp | Dimensiune | 262 B |
Data încărcării | 07 Noiembrie 2024, 10:09 | Scor / rezultat | Eroare de compilare |
medie_patratica.cpp:4:6: error: expected nested-name-specifier before '-' token using-name-space-std; ^ medie_patratica.cpp:4:6: error: expected unqualified-id before '-' token medie_patratica.cpp:4:6: error: expected ';' before '-' token medie_patratica.cpp:4:6: error: expected unqualified-id before '-' token medie_patratica.cpp: In function 'int main()': medie_patratica.cpp:9:5: error: 'cin' was not declared in this scope cin>>n; ^ medie_patratica.cpp:9:5: note: suggested alternative: In file included from medie_patratica.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ medie_patratica.cpp:10:18: warning: right operand of comma operator has no effect [-Wunused-value] for(i=1,i<=n;i++) ^ medie_patratica.cpp:10:25: error: expected ';' before ')' token for(i=1,i<=n;i++) ^ medie_patratica.cpp:13:9: error: 'S' was not declared in this scope S=S + x*; ^ medie_patratica.cpp:13:17: error: expected primary-expression before ';' token S=S + x*; ^ medie_patratica.cpp:15:9: error: 'cout' was not declared in this scope cout<<fixed<<set precision(2)<<Mp ^ medie_patratica.cpp:15:9: note: suggested alternative: In file included from medie_patratica.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ medie_patratica.cpp:15:15: error: 'fixed' was not declared in this scope cout<<fixed<<set precision(2)<<Mp ^ medie_patratica.cpp:15:15: note: suggested alternative: In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from medie_patratica.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:964:3: note: 'std::fixed' fixed(ios_base& __base) ^ medie_patratica.cpp:15:22: error: 'set' was not declared in this scope cout<<fixed<<set precision(2)<<Mp ^ medie_patratica.cpp:15:26: error: expected ';' before 'precision' cout<<fixed<<set precision(2)<<Mp ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema medie_patratica 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ă.