Turbo-C
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
터보-C 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
Lua 게시판
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C/C++ Q/A
[1503] 흐흐... STL을 사용하는 방법... *^^*
김백일 [cedar] 1384 읽음    2002-11-08 20:30
#include <cctype>
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    string str;
    getline(cin, str);

    int alpha = count_if(str.begin(), str.end(), isalpha),
        digit = count_if(str.begin(), str.end(), isdigit),
        other = str.length() - alpha - digit;

    cout << "alpha = " << alpha << endl
         << "digit = " << digit << endl
         << "other = " << other << endl;

    return 0;
}


+ -

관련 글 리스트
1501 문자열을 입력받아서 알파벳이나 숫자나 그외의 문자 갯수 출력하는 프로그램인데... 박중혁 1829 2002/11/08
1503     흐흐... STL을 사용하는 방법... *^^* 김백일 1384 2002/11/08
1502     Re:문자열을 입력받아서 알파벳이나 숫자나 그외의 문자 갯수 출력하는 프로그램인데... 조준회 1614 2002/11/08
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.