U E D R , A S I H C RSS

새싹교실/2011/學高/4회차



1.

  • , 그 7
    • Input three integers: 2 3 7
    • The sum of your integers plus 7 is 19

  • " x y z x + y * z " . -
  • Hint

#include <stdio.h>

int main()
{
 int x,y,z;
 
 // scanf()   기
 
 // printf() 결과 기

 return 0;
}

2. 2011 3 28

2.1. :

2.1.1. (fact)


  • printf
    • %d: decimal integer
    • %c: character
    • %.2f: float

  • escape character
    • \n:
    • \t:
    • \", \': ",'
    • \\: \
  • 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.1.3. (feeling/finds)

  • .
  • . .

2.2. :

2.2.1. (fact)

printf,scanf . .
%d : %.2f :
define PI 3.141592<< 코딩할때 PI라고 쓰면 숫자로 인식함. define은 중간에 수정 불가.
int float


2.2.2. (feeling/finds)

. ~

2.2.3.



2.3. :

2.3.1. (fact)

escape character
\n
\t tab
..
getchar(), putchar() ..
Ascii code ..

printf scanf .

printf 거고 scanf ? ..?
%d :
%.f : if, %.2f . ( .)

int
float
double
char
..




2.3.2. (feeling/finds)

feedback .
.

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;


}

2.4. :

2.4.1. (fact)

.. , ..

ㅠㅠ
길게 .. .. .. ㅎ그귷ㄱ
.
길게길게
-

.. ..
float double , .
고 printf scanf
..
.
%d %f d 고 f -


2.4.2. (feeling/finds)

.
-

2.4.3.

궁금.
-
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:42
Processing time 0.0202 sec