archive
[C언어 실습/기컴프 과제] 6.20 본문
프로그래밍연습 6.20
문자열을 입력 받고 대문자와 소문자의 수를 세는 C 프로그램을 작성하라
-
#include <stdio.h>
#include <ctype.h>
void main()
{
char input[1000];
int temp1 = 0, temp2 = 0;
int count = 0;
printf("문자열을 입력하세요 \n");
gets_s(input);
while (input[count]) {
if (isupper(input[count])=1)
temp1++;
else
temp2++;
}
printf("대문자 : %d\n", temp1);
printf("소문자 : %d\n", temp2);
}
-
'C \ C++ > 22_1 기컴프 (C)' 카테고리의 다른 글
[C언어 실습/기컴프 과제] 7.6 (0) | 2022.06.21 |
---|---|
[C언어 실습/기컴프 과제] 7.2 (0) | 2022.06.21 |
[C언어 실습/기컴프 과제] 6.14 (0) | 2022.06.21 |
[C언어 실습/기컴프 과제] 5.7 (0) | 2022.06.21 |
[C언어 실습/기컴프 과제] 5.3 (0) | 2022.06.21 |