- 13
-
gimmepoint
- 조회 수 158
#include< iostream >
#include< cmath >
using namespace std;
int main()
{
int n;
cin >> n;
double a[50] = {};
for (int i = 0; i < n; i++)
cin >> a[i];
double avg = 0;
for (int i = 0; i < n; i++)
avg += a[i];
avg /= n;
cout << avg << endl;
double sum = 0;
for (int i = 0; i < n; i++)
{
a[i] -= avg;
a[i] *= a[i];
sum += a[i];
}
sum /= n;
cout << sum << endl;
sum = sqrt(sum);
cout << sum << endl;
return 0;
}
표준편차를 구하는 프로그램입니다
선생님이 계산기로 풀라고 하는 문제들을 풀어주고 있습니다
계산기 누르기는 생각만 해도 귀찮아서 만들었습니다
하핳
출력예시
16
1000 1000 1000 1000 1000 1000 1000 1000 1000 1200 1400 1400 1400 1600 1600 1600
1200
60000
244.949
작성자
댓글 13
![title : 황금 서버 (30일) title: 황금 서버 (30일)](https://sfuhost.com/./files/iconshop/33055af84f02ddedb19db038cdae0d2f.gif)
![profile image](/files/member_extra_info/profile_image/569/001/1569.png?t=1527385219)
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![title : 대한민국 국기 title: 대한민국 국기](https://sfuhost.com/./files/iconshop/5e6a5732aa3e4f353e2c3dbcdd6ea333.gif)
엑셀이 없어요
ㅠㅠ
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![title : 황금 서버 (30일) title: 황금 서버 (30일)](https://sfuhost.com/./files/iconshop/33055af84f02ddedb19db038cdae0d2f.gif)
![profile image](/files/member_extra_info/profile_image/569/001/1569.png?t=1527385219)
그러면 구글 스프레드 시트가 있지요 ㅎ...
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![profile image](/files/member_extra_info/profile_image/296/352/352296.png?t=1526968915)
뭐... 뭔말이지... for sum 썸 타는건가..
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![title : 대한민국 국기 title: 대한민국 국기](https://sfuhost.com/./files/iconshop/5e6a5732aa3e4f353e2c3dbcdd6ea333.gif)
어디인지 알려주시면 친절하게 해설해드리겠습니다 ^^
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![profile image](/files/member_extra_info/profile_image/628/211/211628.jpg?t=1508814573)
ㅋㅋㅋ 저게 더 귀찮을듯한 ㅡㅡ;;;;;;;
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![title : 대한민국 국기 title: 대한민국 국기](https://sfuhost.com/./files/iconshop/5e6a5732aa3e4f353e2c3dbcdd6ea333.gif)
ㅋㅋ ㅇㅈ
차라리 밑 댓글처럼 할걸 그랬어요...
ㅠㅠ
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![profile image](/files/member_extra_info/profile_image/145/220/220145.jpg?t=1603012768)
저는 그냥 '표준편차 계산기' 를 쓰렵니다ㅋㅋㅋㅋ
만들 필요도 없고, 계산기를 여러번 두드릴 필요도 없고..!
http://mwultong.blogspot.com/2008/01/sum-average-stdev-median-calc.html
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![title : 대한민국 국기 title: 대한민국 국기](https://sfuhost.com/./files/iconshop/5e6a5732aa3e4f353e2c3dbcdd6ea333.gif)
ㅎ ㅓ ㄱ ........
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![profile image](/files/member_extra_info/profile_image/716/323/323716.jpg?t=1527473519)
계산기앱을 사용하시는편이.....ㅎㅎ
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![title : 대한민국 국기 title: 대한민국 국기](https://sfuhost.com/./files/iconshop/5e6a5732aa3e4f353e2c3dbcdd6ea333.gif)
제기 귀차니즘 말기 환자인데다가 풀 문제가 많은지라...
ㅎㅎ
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![title : 에그 title: 에그](https://sfuhost.com/./files/iconshop/738f0295450a95a257cce1f403834520.gif)
![profile image](/files/member_extra_info/profile_image/136/324/324136.jpg?t=1535776672)
게산기를 사용하시면 되지만 저런걸로 게산하는게 대단하네요!!
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
![title : 대한민국 국기 title: 대한민국 국기](https://sfuhost.com/./files/iconshop/5e6a5732aa3e4f353e2c3dbcdd6ea333.gif)
하핳
![comment menu](/modules/board/skins/comely_board/images/icn_more.png)
차라리 엑셀을 쓰시는 편이??? ㅋㅋㅋㅋㅋㅋㅋ