본문 바로가기

C언어프로그래밍/소스코드

OJ 1193

반응형
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>

char str[100][100] = { 0, };

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%s", str[i]);

		for (int j = 0; j < strlen(str[i]); j++)
		{
			if (isupper(str[i][j]) != 0 )
			{
				str[i][j] = tolower(str[i][j]);
			}
			else
			{
				str[i][j] = toupper(str[i][j]);
			}
		}
	}
	for (int i = 0; i < n; i++)
	{
		printf("%s\n", str[i]);
	}
}
반응형

'C언어프로그래밍 > 소스코드' 카테고리의 다른 글

OJ 1194  (2) 2016.06.08
OJ 1195  (0) 2016.06.08
바이오리듬 프로그램  (0) 2016.05.26
OJ 1184 모기, 지카바이러스 문제 답  (0) 2016.05.17
OJ 1173  (0) 2016.04.25