1. ¶
- , 한 7 하 하
- Input three integers: 2 3 7
- The sum of your integers plus 7 is 19
- Input three integers: 2 3 7
- " x y z x + y * z 하" 하 . - 하
- Hint
#include <stdio.h> int main() { int x,y,z; // scanf() // printf() 하 return 0; }
2.1.1. (fact) ¶
- 트
- printf
- %d: decimal integer
- %c: character
- %.2f: float
-
- %d: decimal integer
- escape character
- \n:
- \t: 탭
- \", \': ",'
- \\: \
- \n:
- 형 data type: int, char
- 형 data type: float, double
- (한 ㅋ)
#include <stdio.h> #define PI 3.141592 int main() { int price; float diameter; printf(": "); scanf("%f",&diameter); printf("( ): "); scanf("%d",&price); diameter/=2;//diameter = diameter/2 printf(": %.2f\n",PI*diameter*diameter); printf(" : %d\n",price/8); return 0; }
2.1.2. ¶
#include<stdio.h> int main() { int x,y,z; printf("Enter 3 integers: "); scanf("%d %d %d",&x,&y,&z); printf("%d+%d+%d+7=%d,x,y,z,x+y+z+7); return 0; }
- 했 하(히 호)
2.2.1. (fact) ¶
printf,scanf해 . 확히 확히 .
%d : %.2f :하
define PI 3.141592<< 코딩할때 PI라고 쓰면 숫자로 인식함. define은 중간에 수정 불가.
int float
%d : %.2f :하
define PI 3.141592<< 코딩할때 PI라고 쓰면 숫자로 인식함. define은 중간에 수정 불가.
int float
2.3.1. (fact) ¶
escape character
\n
\t tab
..
getchar(), putchar() ..
Ascii code ..
\n
\t tab
..
getchar(), putchar() ..
Ascii code ..
printf scanf .
printf 하 scanf ? ..?
%d :
%.f : if, %.2f 하 . ( 하 .)
%d :
%.f : if, %.2f 하 . ( 하 .)
int
float
double
char
..
float
double
char
..
2.3.3. ¶
#include <stdio.h> int main () { int x, y, z; printf(" 3 해:\n"); scanf("%d %d %d",&x,&y,&z); printf("3 합 7 한 : %d\n", x+y+z+7); return 0; }