2016년 6월 8일 수요일

이것이 c언어다. 11장 숫자변환

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    char chInteger [10] = "";
    int nCount = 0;
    int nInteger = 0;


    while(1)
    {
        chInteger[nCount] = getchar();
        if(chInteger[nCount] == '\n')break;
        nCount++;
    }
    nInteger = atoi(chInteger) + 10;
    printf("%d\n",nInteger);

    return 0;
}


댓글 없음:

댓글 쓰기