[2743] 단어 길이 재기

sky·2022년 8월 4일
0

BaekJoon Online Judge(B)

목록 보기
52/98
post-thumbnail

문제

Bronze Ⅴ

알파벳으로만 이루어진 단어를 입력받아, 그 길이를 출력하는 프로그램을 작성하시오.

입력
첫째 줄에 영어 소문자와 대문자로만 이루어진 단어가 주어진다. 단어의 길이는 최대 100이다.

출력
첫째 줄에 입력으로 주어진 단어의 길이를 출력한다.


Solution

C++

#include <iostream>
#include <string>
using namespace std;

int main() {
    string str;
    cin >> str;
    cout << str.length();
    return 0;
}

Python

n = input()
print(len(n))

Total Time

  • 2022-08-05 | 00:42 - 00:43 Success!
profile
개발자가 되고 싶은 1人

0개의 댓글

Powered by GraphCDN, the GraphQL CDN