結果
問題 |
No.163 cAPSlOCK
|
ユーザー |
![]() |
提出日時 | 2019-08-09 15:28:49 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 752 bytes |
コンパイル時間 | 469 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 07:38:35 |
合計ジャッジ時間 | 1,052 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(void) { char password[150]=""; char eng[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; int lower[150]={0}; scanf("%s",password); for(int i=0;i<strlen(password);i++) { for(int j=0;j<26;j++) { if(password[i]==eng[j]) { lower[i]=1; } } } for(int i=0;i<strlen(password);i++) { if(lower[i]==1) { password[i]=toupper(password[i]); } else { password[i]=tolower(password[i]); } printf("%c",password[i]); } }