Give you a integer number N (1 ≤ n ≤ 2 ∗ 10100). Please compute S = 11 + 22 + 33 + . . . + N N Give the last digit of S to me.
Input file consists of several N ’s, each N a line. It is ended with N = 0.
For each N give a line containing only one digit, which is the last digit of S.
範例輸入 1
1 2 3 0
範例輸出 1
1 5 2
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.