3. feedback ¶
- ZeroPage 는만 4F(ThreeFs + Future Action Plan) 맞 feedback .
- Facts, Feelings, Findings, Future Action Plan. , , 느낀 , , .
- 를 들 돈를 먹 대 를 면 : " 남 5만는 돈를 먹.() 대를 는데 맛 .(느낌) 남 만 보 맛 대면 는 .() 는 미리 보 높 돈 봐.( )"
- 마 보 더 ? 믿
- 마 보 더 ? 믿
- Facts, Feelings, Findings, Future Action Plan. , , 느낀 , , .
- feedback 대 .
- ZeroWiki . 를 만는 .
- 러들 배 내 리. 더 .
- ZeroWiki . 를 만는 .
- ZeroWiki는 MoniWiki Engine 며 Google Chrome Mozila Firefox, Safari보는 Internet Explorer 돌는 .
4.1.1. 내 ¶
- 변 방: Datatype name or Datatype name,name,name,...
- Data type: 변 는 데 범를 낸. 변 메모리 를 낸.
- sizeof(parameter): 매변 는 메모리 바 를 .
- sizeof(int) = 4, sizeof(char) = 1, sizeof(short) = 2 etc.
- sizeof(int) = 4, sizeof(char) = 1, sizeof(short) = 2 etc.
- overflow: 변 는 범를 데를 대 는 , 데 . 밍 를 !
- Global variable
- 램 디 능.
- 램 메모리 .
- Local variable
- 변 는 (블럭 { })만 능.
- 블럭 면 메모리 .
- Static variable
- 부 변럼 능.
- 램 메모리 .
- 배 배.
- 변를 변를 변보 .
- 변를 만 마! 변 .
4.1.2. ¶
- #define pi 3.141592를 , 부를 는 램 만.(를 )
- swap(int num1, int num2)를 . 배 문, 리 를 배 문 본 를 .
void swap(int num1,int num2); int main(void){ int num1, num2; printf(" 2를 : "); scanf("%d %d",&num1,&num2); printf("num1: %d, num2: %d\n",num1, num2); swap(num1,num2); } void swap(int num1,int num2){ // printf("after swap\nnum1: %d, num2: %d\n",num1, num2); }
: 변 대 배. 많 내 배 부 . 면 료 므 는 . 부 보
4.2.1. 내 ¶
- 문 if
if(){ 리내 }
- 만 블
- 논리 들 ( = 0 , = 0)
- 논리 들 ( = 0 , = 0)
- 논리란?
- true/false 능
- 논리(&&,||,== 등)를 .
- 1) 를 받 는 램
#include <stdio.h> int main(void){ int num; scanf_s("%d",&num); if(num%2==0) printf(""); else printf(""); return 0; }
-
- 러 .
- 논리 . ex) if(x==2&&y==3)
- parenthesis()를 를 부 . ex) if((x==2&&y==3)||z==4)
- 2)
#include <stdio.h> int main(void){ int year; scanf_s("%d",&year); if((year%4==0&&year%100!=0)||year%400==0) printf(""); else printf(""); return 0; }
- 문 if 른 if문 . (dangling else)
if(){ 리내 if(){ 리내 } }
- 복문
- while: 만는 무 복 리
- for: 만 만 복 리
- do while: 3 명.
- while
- 무복 문 못는 램 만들 .
- 무복 를 벗 . -> break,return
- continue
- continue 는 명들 리 복문 돌.(물 )
- 3) a부 z 는 램 만들
#include <stdio.h> int main(void){ char letter = 'a'; while(letter<='z'){ printf("%c",letter); letter++; } return 0; }
- 4) -1 를 받 는 램
#include <stdio.h> int main(void){ int number; int sum = 0; int count = 0; scanf_s("%d",&number); while(number!=-1){ sum += number; count++; scanf_s("%d",&number); } if(sum==0&&count==0) printf("0"); else printf("%d",sum/count); return 0; }
- 5) -1 를 받 들만
#include <stdio.h> int main(void){ int number; int sum = 0; int count = 0; scanf_s("%d",&number); while(number!=-1){ if(number%2==0){ sum += number; count++; } else scanf_s("%d",&number); } if(sum==0&&count==0) printf("0"); else printf("%d",sum/count); return 0; }
4.3.1. 내 ¶
- for(;;)
- , , !
- for를 while럼 .
- for를 는 : 복리 명
- while 는 : 복리 명 ( 복 만 )
- 1) 를 받 만 #
#include <stdio.h> int main(void){ int num,i; scanf("%d",&num); for(i=0;i<num;i++) printf("#"); return 0; }
- 2) .
#1 * #2 ** #3 *** #4 ****
#include <stdio.h> int main(void){ int i,j; for(i=0;i<4;i++){ printf("#%d ",i+1); for(j=0;j<i;j++) printf("*"); printf("\n"); } }
- 3) <>
(1)* (2)**** ** *** *** ** **** * (3)**** (4) * *** ** ** *** * **** (5) * (6)***** *** *** ***** * ******* (7) * (8)***** *** *** ***** * *** *** * ***** (9) * * (10) ***** ** ** ** ** ***** * * ** ** ** ** * * ***** (11) 1 1 2 2 3 3 4 4 5 6 6 7 7 8 8 9 9
- 4) 를 받 2 .
#include <stdio.h> int main(void){ int num,tmp,count=0; int i,j; scanf("%d",&num); tmp=num; while(tmp>=1){ tmp/=2; count++; } for(i=0;i<count-1;i++){ tmp=num; if(i==0){ for(j=0;j<count-2;j++) tmp/=2; printf("%d%d",tmp/2,tmp%2); continue; } for(j=0;j<count-2-i;j++) tmp/=2; printf("%d",tmp%2); } return 0; }: for 문 떻 는 봤. 는
4.4.1. 내 ¶
- switch문 방: case by case
- if문 switch를 .
- switch 문 break를 는 , case를 부 리 .(if문 른 )
- getch(): stdin 는. 는 리만 명 !
- putch(): 는 면 . 마 리만 .
#include <stdio.h> #include <conio.h> int main(void){ char ch; ch=getch(); switch(ch){ case 'a': printf("른 는 a ."); break; case 'b': printf("른 는 b ."); break; default: printf("른 는 "); putch(); printf("."); } return 0; }
- 는? 동 념. 매변를 면 !
- 매변: func(int a,int b) a b
- : 료,
- 변 료 면 .
- void 는 는 .
- int main() return 0를 는 : 메 는 0 면 램 났는 린.
- void main() 메 !
- : 러 '런 런 를 ' 리는 .
- : 러 '런 런 는 런 런 ' 리는 .
- : 매변 등 리는 .
- printf("%d",add(1,3)); add(1,3) 리 4 들.
- 2) 2를 받 는 램 만들.
#include <stdio.h> int mean(int a,int b); int main(void){ int num1,num2; scanf("%d",&num1); scanf("%d",&num2); printf("%d",mean(num1,num2)); return 0; } int mean(int a,int b){ int count=2// count 변 동는 데는 . 배 배 립. return (a+b)/count; }