prog1

来自「我搜集的C 语言教程」· 代码 · 共 32 行

TXT
32
字号
/*  PARESH CHHOTUBHAI
    CS 362A : " C " LANGUAGE
    SPRING 1988
    ASSIGNMENT #1
    " C " WORKBOOK : PAGE 26, 26A
    DUE DATE : APRIL 14,1988
    MR. DAVID JOHNSON
*/
/*  Program with function to triple a number */

/*  This program has a main program
    and a function called triple ().
    This function  calculates
    and returns three times its input parameter.
*/  

main()
{
int answer; /*  working integer variable */

    answer = triple (5);
    printf ("The result is %d", answer);
}

/*  The function  triple  starts here. */
    
triple (n)
int n;          /* declaration of function parameter */
{
    return (n + n + n);  /* triples the input parameter */
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?