No Rules Rules

A/B (feat. 백준, 1008번) 본문

생활/코테

A/B (feat. 백준, 1008번)

개발하는 완두콩 2022. 8. 9. 11:56
728x90
반응형

A/B
https://www.acmicpc.net/problem/1008

 

1008번: A/B

두 정수 A와 B를 입력받은 다음, A/B를 출력하는 프로그램을 작성하시오.

www.acmicpc.net

 

반응형

 

// woohyeon.kim
// kim519620.tistory.com
#include <iostream>
using namespace std;
int main() {
	ios::sync_with_stdio(false), cin.tie(NULL);
	register int A, B;
	cin >> A >> B;
	cout.precision(10);
	cout << (double)A / B;
	return 0;
}
// *&)*@*
  1. cout의 precision을 통해 출력할 최대 소수점 자릿수를 지정할 수 있습니다.
  2. 정답이 0.1인 경우, 소수점 한자리에서 끝나므로 0.1만 출력됩니다.
728x90
반응형

'생활 > 코테' 카테고리의 다른 글

??! (feat. 백준, 10926번)  (0) 2022.08.09
사칙연산 (feat. 백준, 10869번)  (0) 2022.08.09
A×B (feat. 백준, 10998번)  (0) 2022.08.09
A-B (feat. 백준, 1001번)  (0) 2022.08.09
A+B (feat. 백준, 1000번)  (0) 2022.08.09
Comments