菜鸟笔记
提升您的技术认知

计算n的阶乘 C语言

阅读 : 23
#include<stdio.h>
#pragma warning (disable:4996)
int main()
{
    int i = 0;
    int n = 0;
    int count = 1;
    printf("请输入:");
    scanf("%d", &n);
    for (i = 1; i <= n; i++)
    {
        count = i*count;
    }
    printf("%d!=%d\n", count);
    return 0;
}