jiecheng1.cpp

来自「这是计算阶乘的例子」· C++ 代码 · 共 16 行

CPP
16
字号
// jiecheng1.cpp : Defines the entry point for the console application.
//
#include <stdafx.h>
//#include<stdlib.h>
#include<stdio.h>
int main(void)
{
	unsigned long n=0,fact=1;
	printf("Input a positive number:");
	scanf("%d",&n);
	for(unsigned int k=1;k<=n;k++)
	
		fact=fact*k;
	printf("the factorial of %d is %d:\n",n,fact);
	return 0;
}

⌨️ 快捷键说明

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