Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
分段函数
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 665, Accepted users: 565
Problem 10453 : No special judgement
Problem description
  有一函数

           x      (x<1)

   y=     2x1   (1<=x<10)

          3x11  (x>=10)

   编写程序根据x的值输出y的值。

Input
  输入将包含若干组数据,第一行为一个整数n,代表下面共有n组数据。接下来的每一行为一个x(共n行),代表一组数据。

Output
  对于每组输入的数据x,输出其y值,每组数据输出一行。计算结果如果为小数,小数点后保留1位有效数字,四舍五入。

Sample Input
2
5
30
Sample Output
9
79
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:2059 today,16258786 total, since 2010-05-07