結果
| 問題 |
No.163 cAPSlOCK
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-28 11:08:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 362 bytes |
| コンパイル時間 | 1,370 ms |
| コンパイル使用メモリ | 156,872 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-04 14:42:17 |
| 合計ジャッジ時間 | 2,132 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 8 |
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:7:14: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | fgets(buf, sizeof(buf), stdin);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
char buf[64];
fgets(buf, sizeof(buf), stdin);
char pass[101];
sscanf(buf, "%s", pass);
for (int i = 0; i < strlen(pass); i++) {
if (pass[i] <= 'Z') {
printf("%c", pass[i] - 'A' + 'a');
} else {
printf("%c", pass[i] - 'a' + 'A');
}
}
printf("\n");
return 0;
}