// 소수
package Silver_V_5;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Ex1312 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
int n = Integer.parseInt(st.nextToken());
for (int i = 0; i < n; i++) {
a %= b;
a *= 10;
}
System.out.println(a / b);
}
}
소수 아래가 크면 정확한 값이 안 나오기 때문에 자연수로 풀었다.
'백준 풀이 > 자바(Java)' 카테고리의 다른 글
| 백준 4796 자바 - 캠핑 (0) | 2024.02.19 |
|---|---|
| 백준 4158 자바 - CD (1) | 2024.02.17 |
| 백준 28074 자바 - 모비스 (0) | 2024.02.16 |
| 백준 8979 자바 - 올림픽 (1) | 2024.02.14 |
| 백준 11728 자바 - 배열 합치기 (1) | 2024.02.10 |