https://www.acmicpc.net/problem/2743
2743번: 단어 길이 재기
알파벳으로만 이루어진 단어를 입력받아, 그 길이를 출력하는 프로그램을 작성하시오.
www.acmicpc.net
<풀이>
#include <stdio.h>
#include <string.h>
int main(){
char a[101];
scanf("%s",a);
printf("%ld",strlen(a));
}
헤더파일 string.h를 사용하여 strlen()함수를 사용하면 쉽게 풀수있다.
'알고리즘' 카테고리의 다른 글
[C] 백준 11718번 : 그대로 출력하기 (0) | 2022.11.10 |
---|---|
[C] 백준 2420번 : 사파리월드 (0) | 2022.11.10 |
[C] 백준 15964번 : 이상한 기호 (0) | 2022.11.09 |
[C] 백준 5522번 : 카드 게임 (0) | 2022.11.09 |
[C] 백준 16394번 : 소수 단어 (0) | 2022.11.09 |