Skip to content

Commit b629c0e

Browse files
committed
CT_410
1 parent 7abc2f1 commit b629c0e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package B2
2+
3+
fun main() {
4+
val T = readLine()!!.toInt()
5+
6+
repeat(T) {
7+
val input = readLine()!!.split(" ")
8+
var num = input[0].toDouble()
9+
10+
for (i in 1 until input.size) {
11+
if (input[i] == "@") {
12+
num *= 3
13+
} else if (input[i] == "%") {
14+
num += 5
15+
} else {
16+
num -= 7
17+
}
18+
}
19+
print(String.format("%.2f\n", num))
20+
}
21+
}

0 commit comments

Comments
 (0)