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.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.0272 sec