#define _CRT_SECURE_NO_WARNINGS
する#include <stdio.hに>
する#include <STDLIB.H>
長いFAC(int型n)は{
(N <0){場合
のprintf( "N <0、日付エラー!")。
0を返します。
}
(N == 0 || N == 1)他の場合は
1を返します。
他の
リターン(FAC(N - 1)* n)は、
}
int型のmain(){
int型のn;
長期のy;
printf( "N =")。
scanf関数( "%のD"、&N);
Y = FAC(N)。
printf( "\ nは、%のD =%のLD!"、N、Y)。
システム(「一時停止」)。
0を返します。
}
#define _CRT_SECURE_NO_WARNINGS
する#include <stdio.hに>
する#include <STDLIB.H>
INTファクト(int型A){
int型のy;
(;> 0、Y = 1 A--)のために
Y = Y *。
Yを返します。
}
(INT nは、INT M){必要INT
INT zを、
Z =ファクト(N)/(実際(M)・ファクト(N - M))。
Zを返します。
}
メインINT(){
int型、X = 10、Y = 6。
int型の結果。
結果=(x、y)は必要とします。
printf( "\ます。nRESULT =%D"、結果)。
システム(「一時停止」)。
}
#define _CRT_SECURE_NO_WARNINGS //计算阶乘
する#include <stdio.hに>
する#include <STDLIB.H>
INT階乗(INT A){
int型I。= 1のint Y;
(;> 0、Y = 1 A--)のために
Y = Y *。
Yを返します。
}
int型のmain(){
int型B。
int型の結果。
printf( "请输入一个数字:");
scanf関数( "%dの"、およびB)。
int型階乗(int型b)は、
RESULT =階乗(B)。
printf( "%dの\ n"は、結果)。
システム(「一時停止」)。
0を返します。
}
#define _CRT_SECURE_NO_WARNINGS
する#include <stdio.hに>
する#include <STDLIB.H>
フロートSUV(フロートX、フロートY){
のprintf( "%F%F"、x、y)は、
リターン(X - Y)
}
int型のmain(){
フロートSUV(フロート、フロート)。
フロートX1、X2、X3;
printf( "入力X1、X2:");
scanf関数( "%F%F"、&X1、X2&);
X3 = SUV(X1、X2);
printf( "\ nsuv =%6.2f"、3回)。
システム(「一時停止」)。
0を返します。
}
する#include <stdio.hに>
する#include <STDLIB.H>
の#include <math.h>の
int型のmain(){
int型、A = 2、B = 3、iを3 =、J = 2。
ダブルC;
C = POW(I)+ POW(B、J)。
printf( "C =%F"、C)。
システム(「一時停止」)。
0を返します。
}
する#include <stdio.hに>
する#include <STDLIB.H>
INT MAX(INT X、Y、Z){
int型TMP。
TMP = X。
もし(Y> TMP)
TMP = Y。
(Z> TMP)であれば、
TMP = Z。
tmpに返します。
}
int型のmain(){
int型A、B、C。
int型のMAX_VALUE。
printf( "请输入三个数字:");
scanf関数( "%D%D%D"、&、&B、&C)。
MAX_VALUE = MAX(A、B、C)。
printf( "%dの\ n"は、MAX_VALUE)。
システム(「一時停止」)。
0を返します。
}