/* date : 2014-09-19 *
* class : C++ Programming *
* Student ID : 5112648 *
* name : 김정빈 *
*/


#include<iostream> // std와 << 연산자를 위한 iostream 참조
#include<string>
using namespace std; //std 생략을 위한 선언
#define MAX_CHAR_SIZE 10000 // 문자열 배열의 최댓값
typedef int element;
void check_char_is_alpha(char *c);
void to_alpa_changer(char *c);
element count_alpa(char *c);

int main(void){
char ch[MAX_CHAR_SIZE];
char abc[27];
cin.getline(ch,10000,';');
cout << "총 알파벳 수" << count_alpa(ch) << endl;
to_alpa_changer(ch);
cout << ch;



return 0;
}
void to_alpa_changer(char *c){
int count = 0;
for( int i = 0; i<MAX_CHAR_SIZE; i++){
c[i] = (char)tolower(c[i]);
}
}
void check_char_is_alpha(char *c,char *eng){

int temp;
for(int i = 0; i<MAX_CHAR_SIZE; i++){
if((char)isalpha(c[i])){
temp = atoi(c) - 97;
eng[temp]++;
}
}
}

element count_alpa(char *c){
int count = 0;
for( int i = 0; i<MAX_CHAR_SIZE; i++){
if((char)isalpha(c[i])){
count++;
}
}
return count;
}

'개발 > Algorithm' 카테고리의 다른 글

Insertion_Sort  (0) 2014.09.23
Selection Sort  (0) 2014.09.23
실습과제 #1  (0) 2014.09.19
원을 만드는 것  (0) 2014.09.12
이진 트리의 연산 // 노드,단말노드의 개수  (0) 2014.06.02
블로그 이미지

잉비니

,