0. 문제
https://codeup.kr/problem.php?id=1085
1. 설계
2. 분석 (순서도)
3. 구현
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include <iostream>
#include <math.h>
#define divideByte 8
#define sizeSection 1024
using namespace std;
int main (void)
{
int SamplingRate = 0;
int QuantizationRate = 0;
int ChannelNum = 0;
int Second = 0;
unsigned int fileSize = 0;
double megaFileSize = 0;
cin >> SamplingRate >> QuantizationRate >> ChannelNum >> Second;
fileSize = (SamplingRate * QuantizationRate * ChannelNum * Second);
megaFileSize = fileSize / (double)divideByte / pow((double)sizeSection, 2.0);
cout << fixed;
cout.precision(1);
cout << megaFileSize << " MB" << endl;
return 0;
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
'C > C++' 카테고리의 다른 글
Copy Constructor (0) | 2019.11.20 |
---|---|
character array vs String (0) | 2019.11.10 |
[백준 2752] 세 수 정렬하기 (0) | 2019.10.28 |
[기초 100제] 98번 설탕과자 뽑기 (0) | 2019.10.27 |
[C++] Reference (0) | 2019.10.05 |