백준 10798 c++

magicdrill·2024년 3월 25일
0

백준 문제풀이

목록 보기
205/655

백준 10798 c++

#include <iostream>
#include <cstring>

using namespace std;
int main(void)
{
	int i, j;
	char arr[5][15] = { NULL };
	char temp[16];
	for (i = 0; i < 5; i++)
	{
		cin >> temp;
		//strcpy_s(arr[i], (int)strlen(temp) + 1, temp);
		for (j = 0; j < (int)strlen(temp); j++)
		{
			if (((int)temp[j] >= 65 && (int)temp[j] <= 90)
				|| ((int)temp[j] >= 97 && (int)temp[j] <= 122)
				|| ((int)temp[j] >= 48 && (int)temp[j] <= 57))
			{
				arr[i][j] = temp[j];
			}
			else
			{
				;
			}
		}
	}
	for (i = 0; i < 15; i++)
	{
		for (j = 0; j < 5; j++)
		{
			if (arr[j][i] != NULL)
			{
				cout << arr[j][i];
			}
			else
			{
				;
			}
		}
	}

	return 0;
}

0개의 댓글