結果

問題 No.163 cAPSlOCK
ユーザー Naoki00712
提出日時 2023-05-30 17:21:17
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 410 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 29,568 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-28 12:19:15
合計ジャッジ時間 1,419 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>

int main()
{
	char s[101];
	scanf("%s", &s);

	int n = strlen(s);

	char* a;
	a = (char*)malloc(sizeof(char) * n);

	for (int i = 0; i < n; i++)
	{
		if (0x41 <= s[i] && s[i] <= 0x5a)
		{
			a[i] = tolower(s[i]);
		}
		else
		{
			a[i] = toupper(s[i]);
		}
	}

	for (int i = 0; i < n; i++)
	{
		printf("%c", a[i]);
	}

	return 0;
}
0