More actions
imported>rjs9611 No edit summary |
imported>rjs9611 No edit summary |
||
| Line 1: | Line 1: | ||
문제1 코드 | 문제1 코드: | ||
#include <stdio.h> | #include <stdio.h> | ||
Revision as of 10:19, 15 May 2015
문제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 i, 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");
for (i = 1; i <= 100; i++){
j = j + i;
}
printf("1~100의 합 = %d\n", j);
printf("1~100의 합 = %d\n", plus(100));
printf("N : "); scanf("%d", &j); printf("1~%d의 합 = %d", j, plus(j));
}