메뉴 건너뛰기

app

조합 구하기.

박영식2002.06.14 17:10조회 수 2574댓글 0

    • 글자 크기
음. 부함수로 짰고. 재귀함수가 아님.
int 형이라 8이상을 입력하면 안 됨.
파일 2는 long형이고, call by reference로 하향식임.
#include <stdio.h>
int gop(int n);
void main()
{
        int x,y;
        int i,j,k;
        printf("This program is combinationn");
        printf("first, input n = ");
        scanf("%d",&x);
        printf("next, input r = ");
        scanf("%d",&y);
        i=gop(x);/*n!*/
        j=gop(y);/*r!*/
        k=gop(x-y);/*(n-r)!*/
        printf("        printf("n%d %d
}
int gop(int n)
{
        int a,res=1;
        for(a=n;a>0;a--)
                 res*=a;
        return(res);
}
박영식 (비회원)
    • 글자 크기
binary_search. (by 박영식) 구조체, 부함수에서 계산하기 (by 박영식)

댓글 달기

박영식
2003.11.05 조회 17485
박영식
2003.11.05 조회 2274
박영식
2003.11.05 조회 2450
박영식
2003.11.05 조회 2169
박영식
2003.11.05 조회 2192
박영식
2003.11.05 조회 3233
박영식
2002.06.14 조회 2574
박영식
2002.04.18 조회 3367
박영식
2002.04.18 조회 3235
이전 1 ... 5 6 7 8 9 10 11 12 13 14 다음
첨부 (0)
위로