Difference between r1.4 and the current
@@ -1,28 +1,132 @@
스팀은 좋은겁니다
{{{
#include<stdio.h>
int main()
{
j += i + 1;
}
3.
int main()
{
printf("1부터 100의 합은 : %d\n",j);
return 0;
{
int a = 0;
{{{
int teamname();
int sum(int);
{
int j = 0;
for (int i = 0; i < 100; i++)
int k;
int j;
teamname();
scanf("%d", &k);
j = sum(k);
printf("1부터 %d의 합은 : %d\n",k, j);
return 0;
}
int teamname(void)
{
printf(" ::##==\n ::## +=\n .**# +=\n . + ** *= +\n . + *+# = :\n .*++*## ...\n *++*+.. : *..\n = ******+%@::. ...: ::\n = . ::%****#*@%#%%#%#%%%+# + ...\n## *==++#***..\n .++**:\n");
printf("팀명: S'팀\n");
printf("팀원: 서영운, 송준호, 유재범\n");
for (int i = 0; i < 40; i++)
printf("#");
printf("\n");
return 0;
}
int sum(int n)
{
int a = 0;
if (n == 0)
{ return n;
} printf("1부터 100의 합은 : %d\n",j);
else
{
a += n;
a += sum(n - 1);
}
return a;
}
}}}
== 문제 2 ==
'''header.h'''
{{{
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#pragma warning(disable:4996)
void teamname(void)
{
printf(" ::##==\n ::## +=\n .**# +=\n . + ** *= +\n . + *+# = :\n .*++*## ...\n *++*+.. : *..\n = ******+%@::. ...: ::\n = . ::%****#*@%#%%#%#%%%+# + ...\n## *==++#***..\n .++**:\n");
printf("팀명: S'팀\n팀원: 서영운, 송준호, 유재범\n");
for (int i = 0; i < 40; i++)
printf("#");
printf("\n");
}
void gugu(void){
int rand_num = 0, count=0;
srand((unsigned)time(NULL));
printf(" 숫자를 입력하세요.\n");
scanf("%d", &count);
for (int k = 0; k < count; k++){
rand_num = rand() % 9 + 1;
printf("%d\n", rand_num);
for (int i = 1; i < 10; i++){
printf("%d * %d = %d\n", i, rand_num, i*rand_num);
}
}
}
}}}
'''소스.c'''
{{{
#include "header.h"
int main()
{
teamname();
gugu();
return 0;}}}
== Extra ==
{{{
#include<stdio.h>void teamname();
int sum(int);
{
int j = sum(100);
int k;
teamname();
scanf("%d", &k);
printf("1부터 %d의 합은 : %d\n", k, sum(k));
return 0;
}void teamname(void)
{
printf(" ::##==\n ::## +=\n .**# +=\n . + ** *= +\n . + *+# = :\n .*++*## ...\n *++*+.. : *..\n = ******+%@::. ...: ::\n = . ::%****#*@%#%%#%#%%%+# + ...\n## *==++#***..\n .++**:\n");
printf("팀명: S'팀\n팀원: 서영운, 송준호, 유재범\n");
for (int i = 0; i < 40; i++)
printf("#");
printf("\n");
}
int sum(int n){
int a = 0;
@@ -32,9 +136,7 @@
}
else
{
a += sum(n - 1);
return a;
}
else
{
a += n;
a += n+sum(n - 1);
}return a;
}
스팀은 좋은겁니다
#include<stdio.h> int teamname(); int sum(int); int main() { int k; int j; teamname(); scanf("%d", &k); j = sum(k); printf("1부터 %d의 합은 : %d\n",k, j); return 0; } int teamname(void) { printf(" ::##==\n ::## +=\n .**# +=\n . + ** *= +\n . + *+# = :\n .*++*## ...\n *++*+.. : *..\n = ******+%@::. ...: ::\n = . ::%****#*@%#%%#%#%%%+# + ...\n## *==++#***..\n .++**:\n"); printf("팀명: S'팀\n"); printf("팀원: 서영운, 송준호, 유재범\n"); for (int i = 0; i < 40; i++) printf("#"); printf("\n"); return 0; } int sum(int n) { int a = 0; if (n == 0) { return n; } else { a += n; a += sum(n - 1); } return a; }
문제 2 ¶
header.h
#include <stdlib.h> #include <time.h> #include <stdio.h> #pragma warning(disable:4996) void teamname(void) { printf(" ::##==\n ::## +=\n .**# +=\n . + ** *= +\n . + *+# = :\n .*++*## ...\n *++*+.. : *..\n = ******+%@::. ...: ::\n = . ::%****#*@%#%%#%#%%%+# + ...\n## *==++#***..\n .++**:\n"); printf("팀명: S'팀\n팀원: 서영운, 송준호, 유재범\n"); for (int i = 0; i < 40; i++) printf("#"); printf("\n"); } void gugu(void){ int rand_num = 0, count=0; srand((unsigned)time(NULL)); printf(" 숫자를 입력하세요.\n"); scanf("%d", &count); for (int k = 0; k < count; k++){ rand_num = rand() % 9 + 1; printf("%d\n", rand_num); for (int i = 1; i < 10; i++){ printf("%d * %d = %d\n", i, rand_num, i*rand_num); } } }
소스.c
#include "header.h" int main() { teamname(); gugu(); return 0; }
Extra ¶
#include<stdio.h> void teamname(); int sum(int); int main() { int k; teamname(); scanf("%d", &k); printf("1부터 %d의 합은 : %d\n", k, sum(k)); return 0; } void teamname(void) { printf(" ::##==\n ::## +=\n .**# +=\n . + ** *= +\n . + *+# = :\n .*++*## ...\n *++*+.. : *..\n = ******+%@::. ...: ::\n = . ::%****#*@%#%%#%#%%%+# + ...\n## *==++#***..\n .++**:\n"); printf("팀명: S'팀\n팀원: 서영운, 송준호, 유재범\n"); for (int i = 0; i < 40; i++) printf("#"); printf("\n"); } int sum(int n) { int a = 0; if (n == 0) { return n; } else { a += n+sum(n - 1); } return a; }