UVa 11547 Automatic Answer (water ver.)
2013-10-19 12:26
776 查看
11547 - Automatic Answer
Time limit: 1.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2542
Last month Alice nonchalantly entered her name in a draw for a Tapmaster 4000. Upon checking her mail
today, she found a letter that read:
“Congratulations, Alice! You have won a Tapmaster 4000. To claim your prize, you must answer the following
skill testing question.”
Alice’s initial feelings of surprised joy turned quickly to those of dismay. Her lifetime record for
skill testing questions is an abysmal 3 right and 42 wrong.
Mad Skills, the leading skill testing question development company, was hired to provide skill testing
questions for this particular Tapmaster 4000 draw. They decided to create a different skill testing question to each winner so that the winners could not collaborate to answer the question.
Can you help Alice win the Tapmaster 4000 by solving the skill testing question?
Program Input
The input begins with t (1 ≤ t ≤ 100), the number of test cases. Each test case contains
an integer n (-1000 ≤ n ≤ 1000) on a line by itself. This n should be substituted into the skill testing question below.
Program Output
For each test case, output the answer to the following skill testing question on a line by itself: “Multiply n by
567, then divide the result by 9, then add 7492, then multiply by 235, then divide by 47, then subtract 498. What is the digit in the tens column?”
Sample Input & Output
INPUT
2 637 -120
OUTPUT
1 3
完整代码:
/*0.016s*/ #include<cstdio> #include<cstdlib> int main() { int t, n; scanf("%d", &t); while (t--) { scanf("%d", &n); printf("%d\n", abs(315 * n + 36962) / 10 % 10); } return 0; }
相关文章推荐
- UVa 272 TEX Quotes (water ver.)
- UVa 12250 Language Detection (water ver.)
- UVa 621 Secret Research (water ver.)
- UVa 10696 f91 (water ver.)
- UVa 488 Triangle Wave (water ver.)
- UVa 11172 Relational Operator (water ver.)
- UVa 10783 Odd Sum (water ver.)
- UVa 10038 / POJ 2575 / ZOJ 1879 Jolly Jumpers (water ver.)
- UVa 12640 Largest Sum Game (water ver.)
- UVa 10055 Hashmat the Brave Warrior (water ver.)
- UVa 10082 WERTYU (water ver.)
- UVa 10071 Back to High School Physics (water ver.)
- UVa 11044 Searching for Nessy (water ver.)
- UVa 10370 Above Average (water ver.)
- UVa 10921 Find the Telephone (water ver.)
- UVa 10252 Common Permutation (water ver.)
- UVa 10300 Ecological Premium (water ver.)
- UVa 10019 Funny Encryption Method (water ver.)
- UVa 11340 Newspaper (water ver.)
- UVa 11150 Cola (water ver.)