| 设为首页 加入收藏 |
当前位置: |
| TOP | |||||||||||
|
UVA - 10162 Last Digit
BackgroundGive you a integer number N (1<=n<=2*10100). Pleasecompute S=11+22+33+…+NN Give the last digit of S to me.
InputInput file consists of several Ns, each N a line. It is ended with N=0.
OutputFor each N give a line containing only one digit, which is the lastdigit of S.
Sample Input1 2 3 0
Sample Output1 5 2 题意:求S的个位是多少 思路:看到这么大的数,先打个表试试,发现每20项是个小循环,每100项是个大循环,直接记录100项的结果计算 #include
|
|||||||||||
| 评论 |
|
|