当前位置: 代码迷 >> C语言 >> [求助][原创]头文件怎么用
  详细解决方案

[求助][原创]头文件怎么用

热度:111   发布时间:2007-02-03 20:28:27.0
[求助][原创]头文件怎么用
long f1 (int p)
{int k;
long r;
long f2(int);
k=p*p;
r=f2(k);
return r;
}
long f2(int q)
{
long c=1;
int i;
for(i=1;i<=q;i++)
c=c*i;
return c;
}
main ()
{ int i;
long s=0;
for (i=2;i<=3;i++)
s=s+f1(i);
printf("\ns=%ld\n",s);
}
这个程序据说是计算S=22!+32!,但我不清楚什么时候用什么头文件.
还有这个程序是函数一章的,具体的如何阶乘在那反映的那?
还有想问大家函数和指针主要的思想是什么?
搜索更多相关的解决方案: 头文件  int  long  SUP  函数  

----------------解决方案--------------------------------------------------------
#include <assert.h>    //设定插入点
#include <ctype.h>     //字符处理
#include <errno.h>     //定义错误码
#include <float.h>     //浮点数处理
#include <fstream.h>    //文件输入/输出
#include <iomanip.h>    //参数化输入/输出
#include <iostream.h>   //数据流输入/输出
#include <limits.h>    //定义各种数据类型最值常量
#include <locale.h>    //定义本地化函数
#include <math.h>     //定义数学函数
#include <stdio.h>     //定义输入/输出函数
#include <stdlib.h>    //定义杂项函数及内存分配函数
#include <string.h>    //字符串处理
#include <strstrea.h>   //基于数组的输入/输出
#include <time.h>     //定义关于时间的函数
#include <wchar.h>     //宽字符处理及输入/输出
#include <wctype.h>    //宽字符分类


不知道这个对楼主有用没?
----------------解决方案--------------------------------------------------------
头文件用
#include "文件名"
引用
如果引用的文件在 include目录下还可以用
#include <文件名>
引用
----------------解决方案--------------------------------------------------------

谢大家了


----------------解决方案--------------------------------------------------------

问大家谁能回答我的第2和3个问题


----------------解决方案--------------------------------------------------------
  相关解决方案