Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

CodeRace/2015.5.15/진짜김정빈: Difference between revisions

From ZeroWiki
imported>rjs9611
No edit summary
(Repair batch-0001 pages from live compare)
 
(One intermediate revision by one other user not shown)
Line 68: Line 68:
}
}


문제 2 헤더:
문제 2 gugu.h:




void team();
void team();
void gugu();
void gugu();
문제 2 메인:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "gugu.h"
void main(){
team();
gugu();
}
void team(){
void team(){


Line 159: Line 144:
}
}


문제 2 CodeRacing.c:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "gugu.h"
void main(){
team();
gugu();
}

Latest revision as of 23:56, 26 March 2026

문제1 코드:

  1. include <stdio.h>


int plus(int n){ if (n == 0){ return 0; } else if (n == 1){ return 1; } else { return n + plus(n - 1); } }

void main(){


int j=0;


printf("
:. : \n"

" *== +++ =**\n"

"
=:  :.. +++  :*.  :==\n"

" *:* **+ ++* * + ***\n" " .+* ** *:*\n" " *=+=  := .+ +:\n" " +=**  :++ . . ...\n" " .===: . . #=============#+\n" " ..:+===: * *=\n" " . . * . .*=\n" " *  :##** .*=\n" " ..++ .*+. * ##**** *=\n" " .  :++*++. =###### +#*#: # ****#. ...:#+\n" "  :==++== =####*****##. ##*#***** ##**= ##****.:::::...\n" " .. =*#******###*= +***#:.***+ .****::***#  :+#***** +\n" " +*#***##*+=:.. +#*#=. ****+*#%*=. .#*** .+*##:#****:+**##.\n" "  :*#*#*==: *#*****.. =*#**. .*****##*: *****+###*. :#***###:\n" " #***** .:. #*****##****#*. =#####**. .****\n" " ... *****+ ....=**.. :******#******= .:+:.\n" " ====+:.. #*******###%*= .:##**##++. +**.\n" " ++#######+=. :*%##***#+. +**\n" " .++=+: ...#***#. ***\n" " =+= . +*#*:  :##\n" " .*+ =  :+:+.\n" " ...+= : .===**\n" " ++ .=.  :+.\n" " ..+*=+ .. +=:.\n" " =**+  :+ #:+ +\n" " ++= .  :+ =*==\n" " +**: ++ ++= . ++\n"

"
+ =+=  ::: **\n"

" = ++ .  :\n" " = *+\n");



printf("Team Name : 진짜김정빈\n"); printf("Team Member : 김정빈, 류재상\n"); printf("########################################\n");

printf("N : "); scanf("%d", &j); printf("1~%d의 합 = %d", j, plus(j)); }

문제 2 gugu.h:


void team(); void gugu(); void team(){


printf("
:. : \n"

" *== +++ =**\n"

"
=:  :.. +++  :*.  :==\n"

" *:* **+ ++* * + ***\n" " .+* ** *:*\n" " *=+=  := .+ +:\n" " +=**  :++ . . ...\n" " .===: . . #=============#+\n" " ..:+===: * *=\n" " . . * . .*=\n" " *  :##** .*=\n" " ..++ .*+. * ##**** *=\n" " .  :++*++. =###### +#*#: # ****#. ...:#+\n" "  :==++== =####*****##. ##*#***** ##**= ##****.:::::...\n" " .. =*#******###*= +***#:.***+ .****::***#  :+#***** +\n" " +*#***##*+=:.. +#*#=. ****+*#%*=. .#*** .+*##:#****:+**##.\n" "  :*#*#*==: *#*****.. =*#**. .*****##*: *****+###*. :#***###:\n" " #***** .:. #*****##****#*. =#####**. .****\n" " ... *****+ ....=**.. :******#******= .:+:.\n" " ====+:.. #*******###%*= .:##**##++. +**.\n" " ++#######+=. :*%##***#+. +**\n" " .++=+: ...#***#. ***\n" " =+= . +*#*:  :##\n" " .*+ =  :+:+.\n" " ...+= : .===**\n" " ++ .=.  :+.\n" " ..+*=+ .. +=:.\n" " =**+  :+ #:+ +\n" " ++= .  :+ =*==\n" " +**: ++ ++= . ++\n"

"
+ =+=  ::: **\n"

" = ++ .  :\n" " = *+\n");



printf("Team Name : 진짜김정빈\n"); printf("Team Member : 김정빈, 류재상\n"); printf("########################################\n");





}


void gugu(){

int i, j, M, N; srand(time(NULL));

team(); scanf("%d", &M);

for (i = 1; i <= M; i++){ N = rand() % 9 + 1; for (j = 1; j < 10; j++){ printf("%d * %d = %d\n", N, j, N*j); } } }


문제 2 CodeRacing.c:

  1. include <stdio.h>
  2. include <stdlib.h>
  3. include <time.h>
  4. include "gugu.h"


void main(){ team(); gugu(); }