Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h> //atoi는 이 해더파일을 사용.
- {
- int cnt=0;
- char num[10];
- while(1)
- {
- num[cnt] = getchar();
- if(num[cnt]==10) break;
- cnt++;
- }
- printf("%d\n", atoi(num)+10);
- return 0;
- }
- /*
- atoi()는 ASCII to Integer의 약자로써 말그대로 아스키코드를 정수형 int로 변환해주는 함수이며 stdlib.h에 포함되어있습니다.
- 어거 말고도 atol()와 atof()는 각각 정수형 long와 실수형 float(또는 double)로 변환해는 함수도 있으며
- 반대로 숫자를 아스키코드로 변환하는 itoa()함수도 있습니다.
- 그리고 64비트환경에서는 _atio64()도 사용가능하지만 32비트를 초과한 값이 아닌 이상사용을 추천하지는 않습니다.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement