More actions
imported>hhrs0427 No edit summary |
imported>h94418 No edit summary |
||
| Line 2: | Line 2: | ||
= Problem 1 = | = Problem 1 = | ||
== | |||
#include <stdio.h> | |||
int root(int i) | |||
{ | |||
if ( i ==0) | |||
{ | |||
return 0; | |||
} | |||
else | |||
{ | |||
return i+root(i-1); | |||
} | |||
} | |||
int main() | |||
{ | |||
int sum =0; | |||
int n; | |||
int i1 = 0; | |||
int n1 = 0; | |||
int sum1 = 0; | |||
int i = 0; | |||
printf("hello world \n\n"); | |||
printf("===========+%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**+==+*##*+==*%@@@@@@@@@@@@@@@@@*+..=+#%%#*+=.:+#@@\n"); | |||
printf("=+*%%%%#*=+*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+=*@@@@@@*+=*@@@@@@@@@@@@@@@@+.:+%@@@@@@@@@#+.=*@\n"); | |||
printf("##@@@@@#+=*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+=*@@@@@@%+=+@@@@@@@@@@@@@@%+.=#@@@@@@@@@@@@@+.=*\n"); | |||
printf("@@@@@@%+=+@@@@@@@%#*++**%@@@@###@@@@#*+++#@@@@@@@@@@@@@@@@@#+=*@@@@@#*++++%@@@@@@@@@@@@+:=*@@@@@@@@@@@@@@#=:+\n"); | |||
printf("@@@@@@+=+#@@@@*+:.::==::.:+*++==*#+==++++==+%@@@@@@@@@@@@@@#+=*==+==+.:++:.+%@@@@@@@@@@+.=#@@@@@@@@@@@@@@#=:+\n"); | |||
printf("@@@@@*==*@@@+:.=*#@@@@@@#+:.+*+=+==*%@@@@%+=+#@@@@@@@@@@@@@#+=*%**#*=:*@@*:=*@@@@@@@@@@+:=#@*****#*******+:=*\n"); | |||
printf("@@@@#+=+@@%=.=*@@@@@@@@@@@#+.=+==+#@@@@@@#+=+=====+*#@@@@@@#+=*@@@@@@@@@@*::%@@@@@@%@%++=.++====:::========+@\n"); | |||
printf("@@@@+=+#@@+.=#@@@@@@@@@@@@@#=:+=+%@@@@@*+::==++*+++=..=*@@@#+=*@@@@@@@@@@*:=##++=======+*=.=*@@@@@@@@@@@@%++*\n"); | |||
printf("@@@*==*@@#=:+@@@@@@@@@@@@@@@+:+=*@@@@#=.=*%@@@@@@@@@%*=.=*@#+=*@@@@@@@@@@*:=*==+#@@%#+=+#@*=.:+*%@@@@%#+=..+*\n"); | |||
printf("@@#+=+@@@#::*@@@@@@@@@@@@@@%+:+=*@@@*::+@@@@@@@@@@@@@@@*::*#+=*@@@@@@%%%@*:=*=+%@@@@@%+=*@@@#+=:.......:=*%@@\n"); | |||
printf("@%+=+%@@@%=.+#+=:===========.:+=*@@#=:+@@@@@@@@@@@@@@@@@*::++=*@@@*=:....=.=++=++***+==+%@@@@@@@%####%@@@@@@@\n"); | |||
printf("@*=+*@@@@@#=.+****************+=*@@*:=#@@@@@@@@@@@@@@@@@#=.++=*@@+.=*%@@*+.=#@#+==+++*%@@@@@@@@@@@@@@@@@@@@@@\n"); | |||
printf("#+=*%%%%%@*+=.:+#@@@@@@@@@@*=:+=*@@*::#@@@@@@@@@@@@@@@@@#=:++=*@%=.+%@@@@+:=#@*+=====++*#@@@@@@@@@@@@@@@@@@@@\n"); | |||
printf("+===========+*+:.:=++**++=..=*+=++*%=.+%@@@@@@@@@@@@@@@%+.=++==+##=.:=+=:..:*==++**#**+==+*%@@@@@@@@@@@@@@@@@\n"); | |||
printf("@%%%%%%%%@@@@@@@%*+=====+*#@@@*+++%@#=.=#@@@@@@@@@@@@@*=.=*@####@@@%*+++*#*==+%@@@@@@@@@#+=+*@@@@@@@@@@@@@@@@\n"); | |||
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%+:.=+#@@@@@@@#*=.:+%@@@@@@@@@@@@@@@+=+*@@@@@@@@@@@@@*=+*@@@@@@@@@@@@@@@\n"); | |||
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+:..::==:..:=*@@@@@@@@@@@@@@@@@#+=+@@@@@@@@@@@@@@%+=+%@@@@@@@@@@@@@@\n"); | |||
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##****#%@@@@@@@@@@@@@@@@@@@@#+=*@@@@@@@@@@@@@@%+=+%@@@@@@@@@@@@@@\n"); | |||
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+=+#@@@@@@@@@@@@@*=+*@@@@@@@@@@@@@@@\n"); | |||
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%+=+*@@@@@@@@@@%*==*@@@@@@@@@@@@@@@@\n"); | |||
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+==+*#%%%#*+==+#@@@@@@@@@@@@@@@@@\n"); | |||
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#*+======++*%@@@@@@@@@@@@@@@@@@@\n"); | |||
printf("Team Name : PiChaIIBan\n"); | |||
printf("강사 : 남효민 새싹 : 최현준 문규환\n\n"); | |||
for(i=1;i <= 40;i++) | |||
{ | |||
printf("#"); | |||
} | |||
sum = root(100); | |||
printf("1~100의 합 = %d\n\n", sum); | |||
scanf("%d",&n); | |||
sum = root ( n ) ; | |||
printf("1 ~ n 까지의 합 = %d", sum); | |||
return 0; | |||
} | |||
= Problem 2 = | |||
#include <stdio.h> | |||
#include "gugu.h" | |||
int main () | |||
{ | |||
int N; | |||
int N1=0, M=0; | |||
int i =0; | |||
RRR(); | |||
scanf ("%d",&N); | |||
GG(N); | |||
printf("M"); | |||
scanf_s("%d",&M); | |||
for ( i=1;i<=M;i++) | |||
{ | |||
srand(time(NULL)); | |||
N1 = rand()%10; | |||
printf("random = %d\n",N1); | |||
GG(N1); | |||
printf("\n"); | |||
} | |||
return 0; | |||
} | |||
==gugu.h== | |||
#include<stdio.h> | #include<stdio.h> | ||
#include<stdlib.h> | |||
#include <time.h> | |||
void RRR () | |||
{ | { | ||
int i = 0; | |||
printf("===========+%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**+==+*##*+==*%@@@@@@@@@@@@@@@@@*+..=+#%%#*+=.:+#@@\n"); | printf("===========+%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**+==+*##*+==*%@@@@@@@@@@@@@@@@@*+..=+#%%#*+=.:+#@@\n"); | ||
| Line 38: | Line 148: | ||
printf("#"); | printf("#"); | ||
} | } | ||
} | |||
void GG(int n) | |||
{ | |||
int i = 0; | |||
for(i = 1; i <= 9; i++) | |||
{ | |||
printf("%d * %d = %d \n", i, n, i * n); | |||
} | |||
} | } | ||
Revision as of 10:47, 15 May 2015
Describe CodeRace/2015.5.15/PiChaIlBan here
Problem 1
#include <stdio.h>
int root(int i)
{
if ( i ==0)
{
return 0;
}
else
{
return i+root(i-1);
}
}
int main()
{
int sum =0;
int n;
int i1 = 0;
int n1 = 0;
int sum1 = 0;
int i = 0;
printf("hello world \n\n");
printf("===========+%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**+==+*##*+==*%@@@@@@@@@@@@@@@@@*+..=+#%%#*+=.:+#@@\n");
printf("=+*%%%%#*=+*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+=*@@@@@@*+=*@@@@@@@@@@@@@@@@+.:+%@@@@@@@@@#+.=*@\n");
printf("##@@@@@#+=*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+=*@@@@@@%+=+@@@@@@@@@@@@@@%+.=#@@@@@@@@@@@@@+.=*\n");
printf("@@@@@@%+=+@@@@@@@%#*++**%@@@@###@@@@#*+++#@@@@@@@@@@@@@@@@@#+=*@@@@@#*++++%@@@@@@@@@@@@+:=*@@@@@@@@@@@@@@#=:+\n");
printf("@@@@@@+=+#@@@@*+:.::==::.:+*++==*#+==++++==+%@@@@@@@@@@@@@@#+=*==+==+.:++:.+%@@@@@@@@@@+.=#@@@@@@@@@@@@@@#=:+\n");
printf("@@@@@*==*@@@+:.=*#@@@@@@#+:.+*+=+==*%@@@@%+=+#@@@@@@@@@@@@@#+=*%**#*=:*@@*:=*@@@@@@@@@@+:=#@*****#*******+:=*\n");
printf("@@@@#+=+@@%=.=*@@@@@@@@@@@#+.=+==+#@@@@@@#+=+=====+*#@@@@@@#+=*@@@@@@@@@@*::%@@@@@@%@%++=.++====:::========+@\n");
printf("@@@@+=+#@@+.=#@@@@@@@@@@@@@#=:+=+%@@@@@*+::==++*+++=..=*@@@#+=*@@@@@@@@@@*:=##++=======+*=.=*@@@@@@@@@@@@%++*\n");
printf("@@@*==*@@#=:+@@@@@@@@@@@@@@@+:+=*@@@@#=.=*%@@@@@@@@@%*=.=*@#+=*@@@@@@@@@@*:=*==+#@@%#+=+#@*=.:+*%@@@@%#+=..+*\n");
printf("@@#+=+@@@#::*@@@@@@@@@@@@@@%+:+=*@@@*::+@@@@@@@@@@@@@@@*::*#+=*@@@@@@%%%@*:=*=+%@@@@@%+=*@@@#+=:.......:=*%@@\n");
printf("@%+=+%@@@%=.+#+=:===========.:+=*@@#=:+@@@@@@@@@@@@@@@@@*::++=*@@@*=:....=.=++=++***+==+%@@@@@@@%####%@@@@@@@\n");
printf("@*=+*@@@@@#=.+****************+=*@@*:=#@@@@@@@@@@@@@@@@@#=.++=*@@+.=*%@@*+.=#@#+==+++*%@@@@@@@@@@@@@@@@@@@@@@\n");
printf("#+=*%%%%%@*+=.:+#@@@@@@@@@@*=:+=*@@*::#@@@@@@@@@@@@@@@@@#=:++=*@%=.+%@@@@+:=#@*+=====++*#@@@@@@@@@@@@@@@@@@@@\n");
printf("+===========+*+:.:=++**++=..=*+=++*%=.+%@@@@@@@@@@@@@@@%+.=++==+##=.:=+=:..:*==++**#**+==+*%@@@@@@@@@@@@@@@@@\n");
printf("@%%%%%%%%@@@@@@@%*+=====+*#@@@*+++%@#=.=#@@@@@@@@@@@@@*=.=*@####@@@%*+++*#*==+%@@@@@@@@@#+=+*@@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%+:.=+#@@@@@@@#*=.:+%@@@@@@@@@@@@@@@+=+*@@@@@@@@@@@@@*=+*@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+:..::==:..:=*@@@@@@@@@@@@@@@@@#+=+@@@@@@@@@@@@@@%+=+%@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##****#%@@@@@@@@@@@@@@@@@@@@#+=*@@@@@@@@@@@@@@%+=+%@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+=+#@@@@@@@@@@@@@*=+*@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%+=+*@@@@@@@@@@%*==*@@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+==+*#%%%#*+==+#@@@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#*+======++*%@@@@@@@@@@@@@@@@@@@\n");
printf("Team Name : PiChaIIBan\n");
printf("강사 : 남효민 새싹 : 최현준 문규환\n\n");
for(i=1;i <= 40;i++)
{
printf("#");
}
sum = root(100);
printf("1~100의 합 = %d\n\n", sum);
scanf("%d",&n);
sum = root ( n ) ;
printf("1 ~ n 까지의 합 = %d", sum);
return 0;
}
Problem 2
#include <stdio.h>
#include "gugu.h"
int main ()
{
int N;
int N1=0, M=0;
int i =0;
RRR();
scanf ("%d",&N);
GG(N);
printf("M");
scanf_s("%d",&M);
for ( i=1;i<=M;i++)
{
srand(time(NULL));
N1 = rand()%10;
printf("random = %d\n",N1);
GG(N1);
printf("\n");
}
return 0;
}
gugu.h
#include<stdio.h>
#include<stdlib.h>
#include <time.h>
void RRR ()
{
int i = 0;
printf("===========+%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**+==+*##*+==*%@@@@@@@@@@@@@@@@@*+..=+#%%#*+=.:+#@@\n");
printf("=+*%%%%#*=+*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+=*@@@@@@*+=*@@@@@@@@@@@@@@@@+.:+%@@@@@@@@@#+.=*@\n");
printf("##@@@@@#+=*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+=*@@@@@@%+=+@@@@@@@@@@@@@@%+.=#@@@@@@@@@@@@@+.=*\n");
printf("@@@@@@%+=+@@@@@@@%#*++**%@@@@###@@@@#*+++#@@@@@@@@@@@@@@@@@#+=*@@@@@#*++++%@@@@@@@@@@@@+:=*@@@@@@@@@@@@@@#=:+\n");
printf("@@@@@@+=+#@@@@*+:.::==::.:+*++==*#+==++++==+%@@@@@@@@@@@@@@#+=*==+==+.:++:.+%@@@@@@@@@@+.=#@@@@@@@@@@@@@@#=:+\n");
printf("@@@@@*==*@@@+:.=*#@@@@@@#+:.+*+=+==*%@@@@%+=+#@@@@@@@@@@@@@#+=*%**#*=:*@@*:=*@@@@@@@@@@+:=#@*****#*******+:=*\n");
printf("@@@@#+=+@@%=.=*@@@@@@@@@@@#+.=+==+#@@@@@@#+=+=====+*#@@@@@@#+=*@@@@@@@@@@*::%@@@@@@%@%++=.++====:::========+@\n");
printf("@@@@+=+#@@+.=#@@@@@@@@@@@@@#=:+=+%@@@@@*+::==++*+++=..=*@@@#+=*@@@@@@@@@@*:=##++=======+*=.=*@@@@@@@@@@@@%++*\n");
printf("@@@*==*@@#=:+@@@@@@@@@@@@@@@+:+=*@@@@#=.=*%@@@@@@@@@%*=.=*@#+=*@@@@@@@@@@*:=*==+#@@%#+=+#@*=.:+*%@@@@%#+=..+*\n");
printf("@@#+=+@@@#::*@@@@@@@@@@@@@@%+:+=*@@@*::+@@@@@@@@@@@@@@@*::*#+=*@@@@@@%%%@*:=*=+%@@@@@%+=*@@@#+=:.......:=*%@@\n");
printf("@%+=+%@@@%=.+#+=:===========.:+=*@@#=:+@@@@@@@@@@@@@@@@@*::++=*@@@*=:....=.=++=++***+==+%@@@@@@@%####%@@@@@@@\n");
printf("@*=+*@@@@@#=.+****************+=*@@*:=#@@@@@@@@@@@@@@@@@#=.++=*@@+.=*%@@*+.=#@#+==+++*%@@@@@@@@@@@@@@@@@@@@@@\n");
printf("#+=*%%%%%@*+=.:+#@@@@@@@@@@*=:+=*@@*::#@@@@@@@@@@@@@@@@@#=:++=*@%=.+%@@@@+:=#@*+=====++*#@@@@@@@@@@@@@@@@@@@@\n");
printf("+===========+*+:.:=++**++=..=*+=++*%=.+%@@@@@@@@@@@@@@@%+.=++==+##=.:=+=:..:*==++**#**+==+*%@@@@@@@@@@@@@@@@@\n");
printf("@%%%%%%%%@@@@@@@%*+=====+*#@@@*+++%@#=.=#@@@@@@@@@@@@@*=.=*@####@@@%*+++*#*==+%@@@@@@@@@#+=+*@@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%+:.=+#@@@@@@@#*=.:+%@@@@@@@@@@@@@@@+=+*@@@@@@@@@@@@@*=+*@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+:..::==:..:=*@@@@@@@@@@@@@@@@@#+=+@@@@@@@@@@@@@@%+=+%@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@##****#%@@@@@@@@@@@@@@@@@@@@#+=*@@@@@@@@@@@@@@%+=+%@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+=+#@@@@@@@@@@@@@*=+*@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%+=+*@@@@@@@@@@%*==*@@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*+==+*#%%%#*+==+#@@@@@@@@@@@@@@@@@\n");
printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#*+======++*%@@@@@@@@@@@@@@@@@@@\n");
printf("Team Name : PiChaIIBan\n");
printf("강사 : 남효민 새싹 : 최현준 문규환\n");
for(i=1;i <= 40;i++)
{
printf("#");
}
}
void GG(int n)
{
int i = 0;
for(i = 1; i <= 9; i++)
{
printf("%d * %d = %d \n", i, n, i * n);
}
}