結果
| 問題 |
No.369 足し間違い
|
| コンテスト | |
| ユーザー |
ReERishun
|
| 提出日時 | 2020-05-18 05:48:59 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 752 bytes |
| コンパイル時間 | 127 ms |
| コンパイル使用メモリ | 30,208 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-10-01 21:53:37 |
| 合計ジャッジ時間 | 639 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | WA * 5 |
ソースコード
#include<stdio.h>
void rr_scanl(int index, int *numBox) {
char str;
for (int i = 0; i<index; i++)
numBox[i] = 0;
int cnt = 0;
int mode = 0;
while (cnt < index) {
str = getchar();
if (str == '\n') {
if (cnt != 0)
break;
}
else if (str < '0' || str > '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;
}
ReERishun