fork download
  1. object Main extends App {
  2. def round(d: Double): Int = {
  3. if (d >= 0) (d + 0.5).toInt else (d - 0.5).toInt
  4. }
  5.  
  6. def FtoC(d: Double): Double = {
  7. (d - 32) / 1.8
  8. }
  9.  
  10. val scan = new java.util.Scanner(System.in)
  11. val count = scan.nextInt
  12. for (i <- 1 to count) {
  13. println(round(FtoC(scan.nextInt)))
  14. }
  15. }
  16.  
Success #stdin #stdout 0.4s 322432KB
stdin
35 564 560 471 434 114 551 448 323 262 240 197 206 146 463 155 56 445 224 157 502 518 580 411 305 42 32 155 555 130 444 252 94 403 122 496
stdout
296
293
244
223
46
288
231
162
128
116
92
97
63
239
68
13
229
107
69
261
270
304
211
152
6
0
68
291
54
229
122
34
206
50
258