結果
| 問題 | No.163 cAPSlOCK |
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2016-08-06 00:59:55 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 300 bytes |
| 記録 | |
| コンパイル時間 | 168 ms |
| コンパイル使用メモリ | 29,124 KB |
| 最終ジャッジ日時 | 2026-02-23 22:12:30 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s", s);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main() {
char s[101];
int i;
scanf("%s", s);
for (i = 0; i < strlen(s); i++) {
if ('a' <= s[i] && s[i] <= 'z') {
s[i] -= ('a' - 'A');
}
else if ('A' <= s[i] && s[i] <= 'Z') {
s[i] += ('a' - 'A');
}
}
printf("%s\n", s);
return 0;
}
くれちー