[C语言]大整数阶乘思路

#include<stdio.h>#include<stdlib.h>/*定义数组的最大位数*/#define MAXARRAY 1000int main(){ int fac[MAXARRAY],add[MAXARRAY]; int top,n,i,j; char ch; clrscr(); while(1) { /*输入要计算的整数*/ while(1) { printf("Please input the integer to compute:\n"); sca...
2010-02-22 22:22 | 阅读 1743 次 | 评论 0 条

[C语言]用while语句求n!

程序代码:#include<stdio.h>#include<stdlib.h>int main(){ int i = 0;/* i为计数器 */ int n; int factorial = 1;/* 保存阶乘的结果 */ puts("*************************************"); puts("* The program will compute *"); puts("* the factotial of an integer *"); puts("****************...
2010-02-22 22:18 | 阅读 4150 次 | 评论 0 条

用C语言编写简单的计算器

C语言代码:#include <stdio.h>char token;/*定义程序要使用到的一些函数*/void match( char expectedToken ) /*对当前的标志进行匹配*/{ if( token == expectedToken ) token = getchar(); /*匹配成功,获取下一个标志*/ else { printf("cannot match\n"); exit(1); /*匹配不成功,退出程序*/ }}int low( void )/*用于计算表达式中级别最低的运算*/{ ...
2010-02-22 22:00 | 阅读 1961 次 | 评论 0 条
浏览19604次