안녕하세요...
혼자서 하려면....답답하겠죠...누구나 마찬가지 입니다...
제가 간단하게 주석을 달았으니...참고 하세요...
꼬리) 설마 숙제 땜에 올린건 아니겠죠???
뱀프 님이 쓰신 글 :
: 혼자 c언어를 배워보겠다고 책한권달랑사서 해보려니
: 예문이 이해가 안갑니다 간단하게 4개 정도 뽑아서 왔는데요..
: 아시는분 있으시면 주석점 달아주세요.. 주석달려진거보면 쉽게 이해할수있을거 같습니다
:
: #include <stdio.h>
: void main(void)
: {
: float grade1; /* declare grade1 as a float variable */
: float grade2; /* declare grade2 as a gloat variable */
: float total; /* declare total as a gloat variable */
: float average; /* dealare average as a gloat variable */
:
: grade1 = 85.5;
: grade2 = 97.0;
: total = grade1 + grade2; --> grade1에 grade2를 더한 값을 total 변수에 저장
: average = total/2.0; --> total값을 2.0으로 나눈후 average에 저장
: printf("The average grade is %f\n",average); --> %f에 average 값을 출력
: }
:
: #include <stdio.h>
: void main (void)
: {
: int mun1;
:
: printf("bytes of storage used by an integer: %d/n", sizeof(num1)); --> 자신의 컴퓨터에서 허용되는 int의 사이즈(sizeof(int))를 구해서 %d 포맷으로 출력.
: }
:
: #include <stdio.h>
: void main (void)
: {
: float radius, circumference;
:
: radius = 2.0;
: circumference = 2.0 * 3.1414 * radius; --> 2.0*3.1414*radius 결과를 circumference에 저장
: printf("The circumference of the circle is %f\n", circumference)' --> %f 포맷으로 circumference 출력
: }
:
: #include <stdio.h>
: void main (void)
: {
: float time, length, pi;
:
: pi = 3,1416
: time = 1.0;
: length = 12.0 * 32.2 * time/(2.0*pi) * time/(2.0*pi); --> 12.0*32.2*time/(2.0*pi)*time(2.0*pi)를 length 변수에 저장
: prientf("The iength is %4.2f inches. \n", length); --> %4.2f 포맷으로 length 출력
: }
:
: 정말 감솨여
|