[C] 알고리즘 117 - Beginner Series #4 Cockroach

박진현·2021년 10월 5일
1

알고리즘 (Javascript / C)

목록 보기
117/125

Q.

The cockroach is one of the fastest insects. Write a function which takes its speed in km per hour and returns it in cm per second, rounded down to the integer (= floored).

For example:

1.08 --> 30
Note! The input is a Real number (actual type is language dependent) and is >= 0. The result should be an Integer.

A)

int cockroach_speed(double s)
{
  return s/3600 * 1000 * 100;
}
profile
👨🏻‍💻 호기심이 많고 에러를 좋아하는 프론트엔드 개발자 박진현 입니다.

0개의 댓글