728x90
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
import java.util.Scanner;
class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int tc=1;tc<=t;tc++) {
int d = sc.nextInt();
int l = sc.nextInt();
int n = sc.nextInt();
int answer = 0;
//long으로 해줘도 됨
double in=0;
for(int i=0;i<n;i++) {
in=(1+i*l*0.01);
answer+=d*in; //데미지 누적 합 계산
}
System.out.println("#"+tc+" "+answer);
}
}
}
식만 문제에서 주어지는 대로 잘 세우면 풀리는 문제이다.( 공격할 때마다 데미지 누적 합 계산)
728x90
'SW Expert Academy > SWEA D3' 카테고리의 다른 글
| [SW Expert Academy] 부먹왕국의 차원 관문 (D3) (0) | 2024.09.19 |
|---|---|
| [SW Expert Academy] N-Queen (D3) (0) | 2024.09.19 |
| [SW Expert Acacemy] 과자 분배 (D3) (0) | 2024.09.15 |
| [SW Expert Academy] 영준이의 카드 카운팅 (D3) (0) | 2024.09.15 |
| [SW Expert Academy] 태혁이의 사랑은 타이밍 (D3) (0) | 2024.09.15 |