algorithm/dimigo.goorm.io
연산자 - 연산자의 활용 예제5
m0nd2y
2018. 7. 5. 20:20
Practice Contents
운동에너지(E)는 물체의 질량과 속력에 따라 달라진다.
E = 1/2 * m(질량) * v(속력) 제곱
물체의 질량과 속력이 주어졌을 때, 운동에너지를 계산하여 소수점 2자리까지 나타내는 프로그램을 작성하시오.
(질량과 속력은 모두 정수로 입력받는다.)
⋇ Please keep the input/output format well.
#include <stdio.h>
int main() {
int a, b;
scanf("%d %d",&a, &b);
printf("%.2lf", 0.5*a*b*b);
return 0;
}