結果
| 問題 |
No.544 Delete 7
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2016-12-22 17:16:50 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 336 bytes |
| コンパイル時間 | 267 ms |
| コンパイル使用メモリ | 21,504 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-21 15:56:21 |
| 合計ジャッジ時間 | 2,311 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 48 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%s", n);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char n[11];
scanf("%s", n);
int len = strlen(n);
char a[11], b[11];
int i;
for (i = 0; i < len; i++) {
if (n[i] == '7') {
a[i] = '1';
b[i] = '6';
}
else {
a[i] = '0';
b[i] = n[i];
}
}
printf("%d %d\n", atoi(a), atoi(b));
return 0;
}
くれちー