728x90 반응형 count21 count count #include #include using namespace std; void main() { const char *str="Oh baby baby,How was I supposed to know " "That something wasn't right here"; size_t num; num=count(&str[0],&str[strlen(str)+1],'a'); printf("이 문장에는 a가 %d개 있습니다.\n",num); } count_if #include #include #include using namespace std; void main() { const char *str="Oh baby baby,How was I supposed to know " "That something was.. 2023. 12. 9. 이전 1 다음 728x90 반응형