Notice
Recent Posts
Recent Comments
Link
250x250
«   2025/07   »
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
Archives
Today
Total
관리 메뉴

피너클의 it공부방

백준 9086 문자열 (c++) : 피너클 본문

백준

백준 9086 문자열 (c++) : 피너클

피너클 2022. 7. 22. 14:22
728x90
반응형

https://www.acmicpc.net/problem/9086

 

9086번: 문자열

입력의 첫 줄에는 테스트 케이스의 개수 T(1 ≤ T ≤ 10)가 주어진다. 각 테스트 케이스는 한 줄에 하나의 문자열이 주어진다. 문자열은 알파벳 A~Z 대문자로 이루어지며 알파벳 사이에 공백은 없으

www.acmicpc.net

간단한 구현문제다.

#include <iostream>
#include <string>

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string str;
		cin >> str;
		cout << str[0] << str[str.length() - 1] << endl;
	}
}

전체코드다.

728x90
반응형
Comments