#include <stdio.h>
#include <stdlib.h>
int solution(const char* my_string) {
int answer = 0;
for(int i=0; i<strlen(my_string); i++){
if(isdigit(my_string[i])) answer += my_string[i]-'0';
}
return answer;
}
'전공부셔 > c' 카테고리의 다른 글
[프로그래머스] 문자 반복 출력하기 (1) | 2023.02.27 |
---|---|
정렬 (0) | 2023.02.26 |
배열 원소 개수 (0) | 2023.02.26 |
[프로그래머스] 문자열 뒤집기 (0) | 2023.02.26 |
size_t, unsigned int 차이 (0) | 2023.02.26 |