문제
알파벳으로만 이루어진 단어를 입력받아, 그 길이를 출력하는 프로그램을 작성하시오.
입력
첫째 줄에 영어 소문자와 대문자로만 이루어진 단어가 주어진다. 단어의 길이는 최대 100이다.
출력
첫째 줄에 입력으로 주어진 단어의 길이를 출력한다.
예제 입력 1
pulljima |
예제 출력 1
8 |
더보기
Solution
#include<stdio.h>
#include<string.h>
int main(void)
{
char word[101]={'\0', };
scanf("%s", word);
printf("%d\n", (int)strlen(word));
return 0;
}
728x90
'백준 알고리즘' 카테고리의 다른 글
<백준 알고리즘> 16673번: 고려대학교에는 공식 와인이 있다 (0) | 2020.07.23 |
---|---|
<백준 알고리즘> 9316번: Hello Judge (0) | 2020.07.23 |
<백준 알고리즘> 2566번: 최댓값 (0) | 2020.07.23 |
<백준 알고리즘> 11942번: 고려대는 사랑입니다 (0) | 2020.07.22 |
<백준 알고리즘> 10801번: 카드게임 (0) | 2020.07.21 |