要求:求10的阶乘
#include <stdio.h> int main(int argc, char *argv[]) { float a = 10,i = 2,j = 1;//用float避免溢出 while(i<=a) { j = j*i; i++; } printf("10! = %f",j); return 0; }
原文地址:https://www.cnblogs.com/Aidongshu/p/8305895.html
时间: 2024-10-12 19:38:50
要求:求10的阶乘
#include <stdio.h> int main(int argc, char *argv[]) { float a = 10,i = 2,j = 1;//用float避免溢出 while(i<=a) { j = j*i; i++; } printf("10! = %f",j); return 0; }
原文地址:https://www.cnblogs.com/Aidongshu/p/8305895.html