Difference between r1.4 and the current
@@ -31,9 +31,7 @@
== 예제1 ==
= 숙제 =
2. 복습하기
3. 복습하기
----
= 숙제 =
1. 복습하기
1. 스터디 시간에 짠 소스 코드 업로드 하기
----
@@ -42,9 +40,108 @@
== 천준현 ==
== 최지혁 ==
== 이원준 ==
== 최지혁 ==
{{{
#include<stdio.h>
int sum_array (int*arr,int a)
{
int sum = 0;
for (int i = 0; i < a; i++)
sum += arr[i];
return sum;
}
int main()
{
int a = 10;
int arr[10] = {1,1,1,1,1,1,1,1,1,1};
printf("%d", sum_array(arr, a));
return 0;
}
}}}
{{{
#include<stdio.h>
void func(char* arr[])
{
int num = 0;
while (num < 5)
{
printf("%c\n", *arr[num]);
num++;
}
}
int main()
{
char * arr[5];
char cha1 = 'a';
char cha2 = 'b';
char cha3 = 'c';
char cha4 = 'd';
char cha5 = 'e';
arr[0] = &cha1;
arr[1] = &cha2;
arr[2] = &cha3;
arr[3] = &cha4;
arr[4] = &cha5;
func(&arr);
return 0;
}
}}}
== 박인서 ===== 숙제 1 ===
{{{
#include<stdio.h>
int show(int * p, int n){
int sum=0,i;
for (i = 0; i < n; i++){
sum += p[i];
}
return sum;
}
int main(){
int a[6] = { 1, 2, 3, 4, 5, 6 };
printf("%d", show(a, 6));
return 0;
}
}}}
=== 숙제 2 ===
{{{
#include <stdio.h>
void func(char * p[])
{
int i;
for(i=0;i<5;i++) printf("%c ",*p[i]);
}
int main()
{
char * p[5];
char a='1',b='2',c='3',d='4',e='5';
p[0]=&a;
p[1]=&b;
p[2]=&c;
p[3]=&d;
p[4]=&e;
func(&p);
return 0;
}
}}}
== 이정재 ==== 이원준 ==
@@ -93,6 +190,42 @@
== 남헌 ==
----
-----------------------------------
[자료구족발보쌈]
----
----
[활동지도/2015][자료구족발보쌈]
* 고문바퀴라뇨..허헣 - [박인서]
#include <stdio.h>
int test(int a[5]);
int test2(char * z[5]);
int main() {
int k[5];
printf("%d", test(k));
char a = 'a', b = 'b', c = 'c', d = 'd', e = 'e';
char * z[5];
z[0] = &a;
z[1] = &b;
z[2] = &c;
z[3] = &d;
z[4] = &e;
test2(&z);
return 0;
}
int test(int a [5]) {
int i;
int count = 0;
for (i = 0; i <= 4; i++) {
count = count + a[i];
}
return count;
}
int test2(char * z[5]) {
int i ;
for (i = 0; i <= 4; i++) {
printf("%c", * z[i]);
}
return 0;
}
5.2. 최지혁 ¶
#include<stdio.h> int sum_array (int*arr,int a) { int sum = 0; for (int i = 0; i < a; i++) sum += arr[i]; return sum; } int main() { int a = 10; int arr[10] = {1,1,1,1,1,1,1,1,1,1}; printf("%d", sum_array(arr, a)); return 0; }
#include<stdio.h> void func(char* arr[]) { int num = 0; while (num < 5) { printf("%c\n", *arr[num]); num++; } } int main() { char * arr[5]; char cha1 = 'a'; char cha2 = 'b'; char cha3 = 'c'; char cha4 = 'd'; char cha5 = 'e'; arr[0] = &cha1; arr[1] = &cha2; arr[2] = &cha3; arr[3] = &cha4; arr[4] = &cha5; func(&arr); return 0; }
5.3.1. 숙제 1 ¶
#include<stdio.h> int show(int * p, int n){ int sum=0,i; for (i = 0; i < n; i++){ sum += p[i]; } return sum; } int main(){ int a[6] = { 1, 2, 3, 4, 5, 6 }; printf("%d", show(a, 6)); return 0; }
5.3.2. 숙제 2 ¶
#include <stdio.h> void func(char * p[]) { int i; for(i=0;i<5;i++) printf("%c ",*p[i]); } int main() { char * p[5]; char a='1',b='2',c='3',d='4',e='5'; p[0]=&a; p[1]=&b; p[2]=&c; p[3]=&d; p[4]=&e; func(&p); return 0; }
5.5.1. 숙제1 ¶
#include<stdio.h> void show(int *brr, int n){ int num=0; for (int i = 0; i < n; i++){ num += brr[i]; } printf("%d ", num); } int main(){ int a = 6; int arr[6] = { 1, 2, 3, 4, 5, 6 }; show(arr, 6); return 0; }
5.5.2. 숙제2 ¶
#include<stdio.h> void show(char **brr){ for (int i = 0; i < 5; i++){ printf("%c\n", *brr[i]); } } void main(){ char a = 'a'; char b = 'b'; char c = 'c'; char d = 'd'; char e = 'e'; char *arr[5] = {&a, &b, &c, &d, &e}; show(&arr); }