#include void rr_scanl(int index, int *numBox) { char str; for (int i = 0; i '9') { if (str == '-') mode = 1; cnt++; } else { if(mode == 0) numBox[cnt] = numBox[cnt] * 10 + (int)str - (int)'0'; else numBox[cnt] = numBox[cnt] * 10 - ((int)str - (int)'0'); } } } int main() { int yukiAns = 0; int ans = 0; int num = 0; int unit[10000]; scanf("%d", &num); rr_scanl(num, unit); scanf("%d", &yukiAns); for (int i = 0; i < num; i++) ans += unit[i]; printf("%d", ans - yukiAns); // 終了コードは0 return 0; }