问题标题: 酷町堂:请大家列举一下所有语句和所需要的头文件

1
0

0
已采纳
姚文涛
姚文涛
中级守护
中级守护
#include<iostream>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<queue>
#include<vector>
#include<string>
#include<stack>
#include<cstdlib>

这个够不够?

姚文涛在2018-02-22 15:44:35追加了内容

 

 

 

 

 

万能头文件
#include<bits/stdc++.h>
1
蒋智航
蒋智航
高级天翼
高级天翼
#include <algorithm>    //STL 通用算法
#include <bitset>     //STL 位集容器
#include <cctype> //字符处理
#include <cerrno>      //定义错误码
#include <cfloat>     //浮点数处理
#include <ciso646> //对应各种运算符的宏
#include <climits>     //定义各种数据类型最值的常量
#include <clocale>     //定义本地化函数
#include <cmath>      //定义数学函数
#include <complex>     //复数类
#include <csignal> //信号机制支持
#include <csetjmp> //异常处理支持
#include <cstdarg> //不定参数列表支持
#include <cstddef> //常用常量
#include <cstdio>      //定义输入/输出函数
#include <cstdlib>     //定义杂项函数及内存分配函数
#include <cstring>     //字符串处理
#include <ctime>      //定义关于时间的函数
#include <cwchar>      //宽字符处理及输入/输出
#include <cwctype>     //宽字符分类
#include <deque>      //STL 双端队列容器
#include <exception>    //异常处理类
#include <fstream>     //文件输入/输出
#include <functional>   //STL 定义运算函数(代替运算符)
#include <limits>      //定义各种数据类型最值常量
#include <list>      //STL 线性列表容器
#include <locale> //本地化特定信息
#include <map>       //STL 映射容器
#include <memory> //STL通过分配器进行的内存分配
#include<new> //动态内存分配
#include <numeric> //STL常用的数字操作
#include <iomanip>     //参数化输入/输出
#include <ios>       //基本输入/输出支持
#include <iosfwd>     //输入/输出系统使用的前置声明
#include <iostream>    //数据流输入/输出
#include <istream>     //基本输入流
#include <iterator> //STL迭代器
#include <ostream>     //基本输出流
#include <queue>      //STL 队列容器
#include <set>       //STL 集合容器
#include <sstream>     //基于字符串的流
#include <stack>      //STL 堆栈容器
#include <stdexcept>    //标准异常类
#include <streambuf>    //底层输入/输出支持
#include <string>     //字符串类
#include <typeinfo> //运行期间类型信息
#include <utility>     //STL 通用模板类
#include <valarray> //对包含值的数组的操作
#include <vector>     //STL 动态数组容器

 

1
被禁言 贾敬波
贾敬波
高级守护
高级守护

主要使用的就是iostream和cstdio,这两个算是标准的输入输出。

cmath是数学函数库

string和cstring是字符串的头文件

0
王紫馨
王紫馨
高级守护
高级守护

你可以在我的电脑里面打开一个文件夹,里面有所有c++的头文件,这个是路径:

C:->Program Files(x86)->Dev-Cpp->MinGW64->x86-64-w64-mingw32->include

按照每一个步骤去找

0
张瑀涵
张瑀涵
高级光能
高级光能

 

#include<iostream>

 

#include<cstdio>

 

#include<cmath>

 

#include<cstring>

 

#include<string>

 

#include<algorithm>

 

#include<map>

 

#include<sstream>

 

#include<queue>

 

#include<vector>

 

#include<cstdlib>

 

#include<stack>

 

#include<bits/stdc++.h>

 

#include<cstdlib.h>

 

#include<windows.h>

 

#include<conio.h>

#include<bits/stdc++.h>

0
刘睿轩
刘睿轩
中级光能
中级光能

万能头:#include<bits/stdc++.h>

0
屠永乐
屠永乐
高级守护
高级守护

#include<iostream>

 

#include<cstdio>

 

#include<cmath>

 

#include<cstring>

 

#include<string>

 

#include<algorithm>

 

#include<map>

 

#include<sstream>

 

#include<queue>

 

#include<vector>

 

#include<cstdlib>

 

#include<stack>

 

#include<bits/stdc++.h>

 

#include<cstdlib.h>

 

#include<windows.h>

 

#include<conio.h>

 

万能头文件:#inckude<bits/stdc++.h>

0
0
0
周墨彧
周墨彧
中级守护
中级守护

#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

0
梁锦程
梁锦程
高级光能
高级光能
C、传统 C++

#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>    //宽字符分类

//////////////////////////////////////////////////////////////////////////

标准 C++ (同上的不再注释)

#include <algorithm>    //STL 通用算法
#include <bitset>     //STL 位集容器
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>     //复数类
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>      //STL 双端队列容器
#include <exception>    //异常处理类
#include <fstream>
#include <functional>   //STL 定义运算函数(代替运算符)
#include <limits>
#include <list>      //STL 线性列表容器
#include <map>       //STL 映射容器
#include <iomanip>
#include <ios>       //基本输入/输出支持
#include <iosfwd>     //输入/输出系统使用的前置声明
#include <iostream>
#include <istream>     //基本输入流
#include <ostream>     //基本输出流
#include <queue>      //STL 队列容器
#include <set>       //STL 集合容器
#include <sstream>     //基于字符串的流
#include <stack>      //STL 堆栈容器    
#include <stdexcept>    //标准异常类
#include <streambuf>    //底层输入/输出支持
#include <string>     //字符串类
#include <utility>     //STL 通用模板类
#include <vector>     //STL 动态数组容器
#include <cwchar>
#include <cwctype>

using namespace std;

//////////////////////////////////////////////////////////////////////////

C99 增加

#include <complex.h>   //复数处理
#include <fenv.h>    //浮点环境
#include <inttypes.h>  //整数格式转换
#include <stdbool.h>   //布尔环境
#include <stdint.h>   //整型环境
#include <tgmath.h>   //通用类型数学宏

C头文件大全

分类函数,所在函数库为ctype.h

int isalpha(int ch)  若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0

int isalnum(int ch)  若ch是字母('A'-'Z','a'-'z')或数字('0'-'9')

                     返回非0值,否则返回0

int isascii(int ch)  若ch是字符(ASCII码中的0-127)返回非0值,否则返回0

int iscntrl(int ch)  若ch是作废字符(0x7F)或普通控制字符(0x00-0x1F)

                     返回非0值,否则返回0

int isdigit(int ch)  若ch是数字('0'-'9')返回非0值,否则返回0

int isgraph(int ch)  若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0

int islower(int ch)  若ch是小写字母('a'-'z')返回非0值,否则返回0

int isprint(int ch)  若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0

int ispunct(int ch)  若ch是标点字符(0x00-0x1F)返回非0值,否则返回0

int isspace(int ch)  若ch是空格(' '),水平制表符('\t'),回车符('\r'),

                     走纸换行('\f'),垂直制表符('\v'),换行符('\n')

                     返回非0值,否则返回0

int isupper(int ch)  若ch是大写字母('A'-'Z')返回非0值,否则返回0

int isxdigit(int ch) 若ch是16进制数('0'-'9','A'-'F','a'-'f')返回非0值,

                     否则返回0

int tolower(int ch)  若ch是大写字母('A'-'Z')返回相应的小写字母('a'-'z')

int toupper(int ch)  若ch是小写字母('a'-'z')返回相应的大写字母('A'-'Z')

数学函数,所在函数库为math.h、stdlib.h、string.h、float.h

int      abs(int i)                    返回整型参数i的绝对值

double  cabs(struct complex znum)      返回复数znum的绝对值

double  fabs(double x)                 返回双精度参数x的绝对值

long    labs(long n)                   返回长整型参数n的绝对值

double   exp(double x)                 返回指数函数ex的值

double frexp(double value,int *eptr)   返回value=x*2n中x的值,n存贮在eptr中

double ldexp(double value,int exp);    返回value*2exp的值

double   log(double x)                 返回logex的值

double log10(double x)                 返回log10x的值

double   pow(double x,double y)        返回xy的值

double pow10(int p)                    返回10p的值

double  sqrt(double x)                 返回+√x的值

double  acos(double x)                 返回x的反余弦cos-1(x)值,x为弧度

double  asin(double x)                 返回x的反正弦sin-1(x)值,x为弧度

double  atan(double x)                 返回x的反正切tan-1(x)值,x为弧度

double atan2(double y,double x)        返回y/x的反正切tan-1(x)值,y的x为弧度

double   cos(double x)                 返回x的余弦cos(x)值,x为弧度

double   sin(double x)                 返回x的正弦sin(x)值,x为弧度

double   tan(double x)                 返回x的正切tan(x)值,x为弧度

double  cosh(double x)                 返回x的双曲余弦cosh(x)值,x为弧度

double  sinh(double x)                 返回x的双曲正弦sinh(x)值,x为弧度

double  tanh(double x)                 返回x的双曲正切tanh(x)值,x为弧度

double hypot(double x,double y)        返回直角三角形斜边的长度(z),

                                       x和y为直角边的长度,z2=x2+y2

double  ceil(double x)                 返回不小于x的最小整数

double floor(double x)                 返回不大于x的最大整数

void   srand(unsigned seed)            初始化随机数发生器

int     rand()                         产生一个随机数并返回这个数

double  poly(double x,int n,double c[])从参数产生一个多项式

double  modf(double value,double *iptr)将双精度数value分解成尾数和阶

double  fmod(double x,double y)        返回x/y的余数

double frexp(double value,int *eptr)   将双精度数value分成尾数和阶

double  atof(char *nptr)               将字符串nptr转换成浮点数并返回这个浮点数

double  atoi(char *nptr)               将字符串nptr转换成整数并返回这个整数

double  atol(char *nptr)               将字符串nptr转换成长整数并返回这个整数

char   *ecvt(double value,int ndigit,int *decpt,int *sign)

         将浮点数value转换成字符串并返回该字符串

char   *fcvt(double value,int ndigit,int *decpt,int *sign)

         将浮点数value转换成字符串并返回该字符串

char   *gcvt(double value,int ndigit,char *buf)

         将数value转换成字符串并存于buf中,并返回buf的指针

char  *ultoa(unsigned long value,char *string,int radix)

         将无符号整型数value转换成字符串并返回该字符串,radix为转换时所用基数

char   *ltoa(long value,char *string,int radix)

         将长整型数value转换成字符串并返回该字符串,radix为转换时所用基数

char   *itoa(int value,char *string,int radix)

         将整数value转换成字符串存入string,radix为转换时所用基数

double atof(char *nptr) 将字符串nptr转换成双精度数,并返回这个数,错误返回0

int    atoi(char *nptr) 将字符串nptr转换成整型数,  并返回这个数,错误返回0

long   atol(char *nptr) 将字符串nptr转换成长整型数,并返回这个数,错误返回0

double strtod(char *str,char **endptr)将字符串str转换成双精度数,并返回这个数,

long   strtol(char *str,char **endptr,int base)将字符串str转换成长整型数,

                                               并返回这个数,

int          matherr(struct exception *e)

              用户修改数学错误返回信息函数(没有必要使用)

double       _matherr(_mexcep why,char *fun,double *arg1p,

                      double *arg2p,double retval)

                用户修改数学错误返回信息函数(没有必要使用)

unsigned int _clear87()   清除浮点状态字并返回原来的浮点状态

void         _fpreset()   重新初使化浮点数学程序包

unsigned int _status87()  返回浮点状态字

目录函数,所在函数库为dir.h、dos.h

int     chdir(char *path) 使指定的目录path(如:"C:\\WPS")变成当前的工作目录,成

         功返回0

int findfirst(char *pathname,struct ffblk *ffblk,int attrib)查找指定的文件,成功

     返回0

     pathname为指定的目录名和文件名,如"C:\\WPS\\TXT"

     ffblk为指定的保存文件信息的一个结构,定义如下:

    ┏━━━━━━━━━━━━━━━━━━┓

    ┃struct ffblk                        ┃

    ┃{                                   ┃

    ┃ char ff_reserved[21]; /*DOS保留字*/┃

    ┃ char ff_attrib;       /*文件属性*/ ┃

    ┃ int  ff_ftime;        /*文件时间*/ ┃

    ┃ int  ff_fdate;        /*文件日期*/ ┃

    ┃ long ff_fsize;        /*文件长度*/ ┃

    ┃ char ff_name[13];     /*文件名*/   ┃

    ┃}                                   ┃

    ┗━━━━━━━━━━━━━━━━━━┛

     attrib为文件属性,由以下字符代表

    ┏━━━━━━━━━┳━━━━━━━━┓

    ┃FA_RDONLY 只读文件┃FA_LABEL  卷标号┃

    ┃FA_HIDDEN 隐藏文件┃FA_DIREC  目录  ┃

    ┃FA_SYSTEM 系统文件┃FA_ARCH   档案  ┃

    ┗━━━━━━━━━┻━━━━━━━━┛

    例:

    struct ffblk ff;

    findfirst("*.wps",&ff,FA_RDONLY);

int   findnext(struct ffblk *ffblk)      取匹配finddirst的文件,成功返回0

void  fumerge(char *path,char *drive,char *dir,char *name,char *ext)

       此函数通过盘符drive(C:、A:等),路径dir(\TC、\BC\LIB等),

       文件名name(TC、WPS等),扩展名ext(.EXE、.COM等)组成一个文件名

       存与path中.

int   fnsplit(char *path,char *drive,char *dir,char *name,char *ext)

       此函数将文件名path分解成盘符drive(C:、A:等),路径dir(\TC、\BC\LIB等),

       文件名name(TC、WPS等),扩展名ext(.EXE、.COM等),并分别存入相应的变量中.

int   getcurdir(int drive,char *direc) 此函数返回指定驱动器的当前工作目录名称

        drive 指定的驱动器(0=当前,1=A,2=B,3=C等)

        direc 保存指定驱动器当前工作路径的变量      成功返回0

char *getcwd(char *buf,iint n) 此函数取当前工作目录并存入buf中,直到n个字

      节长为为止.错误返回NULL

int   getdisk() 取当前正在使用的驱动器,返回一个整数(0=A,1=B,2=C等)

int   setdisk(int drive) 设置要使用的驱动器drive(0=A,1=B,2=C等),

       返回可使用驱动器总数

int   mkdir(char *pathname)  建立一个新的目录pathname,成功返回0

int   rmdir(char *pathname)  删除一个目录pathname,成功返回0

char *mktemp(char *template) 构造一个当前目录上没有的文件名并存于template中

char *searchpath(char *pathname) 利用MSDOS找出文件filename所在路径,

      ,此函数使用DOS的PATH变量,未找到文件返回NULL

进程函数,所在函数库为stdlib.h、process.h

void  abort() 此函数通过调用具有出口代码3的_exit写一个终止信息于stderr,

        并异常终止程序。无返回值

int   exec…装入和运行其它程序

int   execl(  char *pathname,char *arg0,char *arg1,…,char *argn,NULL)

int   execle( char *pathname,char *arg0,char *arg1,…,

              char *argn,NULL,char *envp[])

int   execlp( char *pathname,char *arg0,char *arg1,…,NULL)

int   execlpe(char *pathname,char *arg0,char *arg1,…,NULL,char *envp[])

int   execv(  char *pathname,char *argv[])

int   execve( char *pathname,char *argv[],char *envp[])

int   execvp( char *pathname,char *argv[])

int   execvpe(char *pathname,char *argv[],char *envp[])

         exec函数族装入并运行程序pathname,并将参数

          arg0(arg1,arg2,argv[],envp[])传递给子程序,出错返回-1

       在exec函数族中,后缀l、v、p、e添加到exec后,

       所指定的函数将具有某种操作能力

      有后缀  p时,函数可以利用DOS的PATH变量查找子程序文件。

              l时,函数中被传递的参数个数固定。

              v时,函数中被传递的参数个数不固定。

              e时,函数传递指定参数envp,允许改变子进程的环境,

                   无后缀e时,子进程使用当前程序的环境。

void  _exit(int status)终止当前程序,但不清理现场

void  exit(int status) 终止当前程序,关闭所有文件,写缓冲区的输出(等待输出),

                       并调用任何寄存器的"出口函数",无返回值

int   spawn…运行子程序

int   spawnl(  int mode,char *pathname,char *arg0,char *arg1,…,

               char *argn,NULL)

int   spawnle( int mode,char *pathname,char *arg0,char *arg1,…,

               char *argn,NULL,char *envp[])

int   spawnlp( int mode,char *pathname,char *arg0,char *arg1,…,

               char *argn,NULL)

int   spawnlpe(int mode,char *pathname,char *arg0,char *arg1,…,

               char *argn,NULL,char *envp[])

int   spawnv(  int mode,char *pathname,char *argv[])

int   spawnve( int mode,char *pathname,char *argv[],char *envp[])

int   spawnvp( int mode,char *pathname,char *argv[])

int   spawnvpe(int mode,char *pathname,char *argv[],char *envp[])

       spawn函数族在mode模式下运行子程序pathname,并将参数

        arg0(arg1,arg2,argv[],envp[])传递给子程序.出错返回-1

       mode为运行模式

        mode为 P_WAIT   表示在子程序运行完后返回本程序

               P_NOWAIT 表示在子程序运行时同时运行本程序(不可用)

               P_OVERLAY表示在本程序退出后运行子程序

        在spawn函数族中,后缀l、v、p、e添加到spawn后,

        所指定的函数将具有某种操作能力

        有后缀 p时, 函数利用DOS的PATH查找子程序文件

               l时, 函数传递的参数个数固定.

               v时, 函数传递的参数个数不固定.

               e时, 指定参数envp可以传递给子程序,允许改变子程序运行环境.

                  当无后缀e时,子程序使用本程序的环境.

int   system(char *command) 将MSDOS命令command传递给DOS执行

转换子程序,函数库为math.h、stdlib.h、ctype.h、float.h

char   *ecvt(double value,int ndigit,int *decpt,int *sign)

         将浮点数value转换成字符串并返回该字符串

char   *fcvt(double value,int ndigit,int *decpt,int *sign)

         将浮点数value转换成字符串并返回该字符串

char   *gcvt(double value,int ndigit,char *buf)

         将数value转换成字符串并存于buf中,并返回buf的指针

char  *ultoa(unsigned long value,char *string,int radix)

         将无符号整型数value转换成字符串并返回该字符串,radix为转换时所用基数

char   *ltoa(long value,char *string,int radix)

         将长整型数value转换成字符串并返回该字符串,radix为转换时所用基数

char   *itoa(int value,char *string,int radix)

         将整数value转换成字符串存入string,radix为转换时所用基数

double atof(char *nptr) 将字符串nptr转换成双精度数,并返回这个数,错误返回0

int    atoi(char *nptr) 将字符串nptr转换成整型数,  并返回这个数,错误返回0

long   atol(char *nptr) 将字符串nptr转换成长整型数,并返回这个数,错误返回0

double strtod(char *str,char **endptr)将字符串str转换成双精度数,并返回这个数,

long   strtol(char *str,char **endptr,int base)将字符串str转换成长整型数,

                                               并返回这个数,

int    toascii(int c)   返回c相应的ASCII

int    tolower(int ch)  若ch是大写字母('A'-'Z')返回相应的小写字母('a'-'z')

int   _tolower(int ch)  返回ch相应的小写字母('a'-'z')

int    toupper(int ch)  若ch是小写字母('a'-'z')返回相应的大写字母('A'-'Z')

int   _toupper(int ch)  返回ch相应的大写字母('A'-'Z')

诊断函数,所在函数库为assert.h、math.h

void   assert(int test) 一个扩展成if语句那样的宏,如果test测试失败,

        就显示一个信息并异常终止程序,无返回值

void   perror(char *string) 本函数将显示最近一次的错误信息,格式如下:

        字符串string:错误信息

char   *strerror(char *str) 本函数返回最近一次的错误信息,格式如下:

        字符串str:错误信息

int    matherr(struct exception *e)

        用户修改数学错误返回信息函数(没有必要使用)

double _matherr(_mexcep why,char *fun,double *arg1p,

                double *arg2p,double retval)

        用户修改数学错误返回信息函数(没有必要使用)

输入输出子程序,函数库为io.h、conio.h、stat.h、dos.h、stdio.h、signal.h

int   kbhit()    本函数返回最近所敲的按键

int   fgetchar() 从控制台(键盘)读一个字符,显示在屏幕上

int   getch()    从控制台(键盘)读一个字符,不显示在屏幕上

int   putch()    向控制台(键盘)写一个字符

int   getchar()  从控制台(键盘)读一个字符,显示在屏幕上

int   putchar()  向控制台(键盘)写一个字符

int   getche()   从控制台(键盘)读一个字符,显示在屏幕上

int   ungetch(int c) 把字符c退回给控制台(键盘)

char *cgets(char *string) 从控制台(键盘)读入字符串存于string中

int   scanf(char *format[,argument…])从控制台读入一个字符串,分别对各个参数进行

       赋值,使用BIOS进行输出

int   vscanf(char *format,Valist param)从控制台读入一个字符串,分别对各个参数进行

       赋值,使用BIOS进行输出,参数从Valist param中取得

int   cscanf(char *format[,argument…])从控制台读入一个字符串,分别对各个参数进行

       赋值,直接对控制台作操作,比如显示器在显示时字符时即为直接写频方式显示

int   sscanf(char *string,char *format[,argument,…])通过字符串string,分别对各个

       参数进行赋值

int   vsscanf(char *string,char *format,Vlist param)通过字符串string,分别对各个

       参数进行赋值,参数从Vlist param中取得

int   puts(char *string)  发关一个字符串string给控制台(显示器),

       使用BIOS进行输出

void  cputs(char *string) 发送一个字符串string给控制台(显示器),

       直接对控制台作操作,比如显示器即为直接写频方式显示

int   printf(char *format[,argument,…]) 发送格式化字符串输出给控制台(显示器)

       使用BIOS进行输出

int   vprintf(char *format,Valist param) 发送格式化字符串输出给控制台(显示器)

       使用BIOS进行输出,参数从Valist param中取得

int   cprintf(char *format[,argument,…]) 发送格式化字符串输出给控制台(显示器),

       直接对控制台作操作,比如显示器即为直接写频方式显示

int   vcprintf(char *format,Valist param)发送格式化字符串输出给控制台(显示器),

       直接对控制台作操作,比如显示器即为直接写频方式显示,

       参数从Valist param中取得

int   sprintf(char *string,char *format[,argument,…])

        将字符串string的内容重新写为格式化后的字符串

int   vsprintf(char *string,char *format,Valist param)

        将字符串string的内容重新写为格式化后的字符串,参数从Valist param中取得

int   rename(char *oldname,char *newname)将文件oldname的名称改为newname

int   ioctl(int handle,int cmd[,int *argdx,int argcx])

还有很多 ,由于字数上限了,就发这么多吧!
0
0
赵逸凡
赵逸凡
初级启示者
初级启示者

#include<iostream>
#include<cmath>
#include<math.h>
#include<cstring>
#include<string.h>
#include<string>
#include<cstdio>
#include<stdio.h>
#include<ctime>
#include<time.h>
#include<sstream>
#include<iomanip>
#include<map>
#include<bits/stdc++.h>
#include<bits\stdC++.h>
#include<bits/stdC++.h>
#include<bits\stdc++.h>
#include<bits/c++config.h>
#include<locale.h>
#ifndef _GLIBCXX_CLOCALE
#define _GLIBCXX_CLOCALE 1
#undef setlocale
#undef localeconv
#endif
#pragma system_header ignored outside include file [enabled by default]
#include<algorithm>
#define _IOS_BASE_H 1
#pragma GCC system_header
#include <ext/atomicity.h>
#include <bits/localefwd.h>
#include <bits/locale_classes.h>
#include <bits/localefwd.h>
//#include <ext/atomicity.h>
#ifndef NO_OLDNAMES
#else
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#ifndef _WSTRING_DEFINED
#define _WSTRING_DEFINED
#ifndef _INC_STRING
#define _INC_STRING
#include <crtdefs.h>
#ifdef __cplusplus
#ifndef NULL
#ifdef __cplusplus
#ifndef _WIN64
#define NULL 0
#define NULL 0LL
#define NULL ((void *)0)
#define _WConst_return _CONST_RETURN
#ifndef _CRT_MEMORY_DEFINED
#define _CRT_MEMORY_DEFINED
#ifndef NO_OLDNAMES
#ifndef __CRT__NO_INLINE
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#ifndef NO_OLDNAMES
#define wcswcs wcsstr
#ifdef __cplusplus
#include <sec_api/string_s.h>
#include <utility>
#include <bits/stl_algobase.h>
#include <bits/stl_algo.h>
#ifndef _GLIBCXX_ALGORITHM
#define _GLIBCXX_ALGORITHM 1
#pragma GCC system_header
#ifdef _GLIBCXX_PARALLEL
# include <parallel/algorithm>
#ifndef _LOCALE_CLASSES_H
#define _LOCALE_CLASSES_H 1
# include <bits/locale_classes.tcc>
#pragma GCC system_header
#ifndef _IOS_BASE_H

0
邵逸儒
邵逸儒
中级天翼
中级天翼

标准c++库包含以下内容:

<algorithm>,<bitset>,<complex>,<deque>,<exception>,<fstream>,<functionl>,<iomanip>,<ios>,<iosfwd>,<iostream>,<isteam>,<iterator>,<limits>,<list>,<locale>,<map>,<memory>,<numeric>,<ostream>,<queue>,<set>,<sstream>,<stack>,<stdxcept>,<streambuf>,<strinig>,<strstream>,<utility>,<valarray>,<vactor>,<cassert>,<cctype>,<cerron>,<cfloat>,<ciso646>,<climits>,<clocale>,<cmath>,<csetjmp>,<csignal>,<cstdrag>,<cstddef>,<cstdio>,<cstdlibn>,<cstring>,<ctime>,<cwchar>,<iso646.h>和<cwchar.h>

标准c++库的详细消息均在其对应的头文件进行了说明。主要标准c++库头文件如下所示。其中13项为标准模板库(STL),在其说明文字的前面标有(STL)的为标准模板库。

<algorithm>---(STL)用于定义实现常用、实用算法的大量模板
<bitset>----- 用于定义官位位集合的模板类
<cassert>-----用于在程序执行时执行断言
<cctype>-----用于对字符进行分类
<cerrno>-----用于测试有库函数提交的错误代码
<cfloat>------用于测试浮点类型属性
<cios646>----用于在ISO646变体字符集中编程
<climits>-----用于测试整数类型属性
<clocale>-----用于使程序适应不同的文化风俗
<cmath>———用于计算常用的数学函数
<complex>-----用于定义支持复杂算法的模板类
<csetjmp>-----用于执行非局部的goto语句
<csignal>------用于控制各种异常情况
<cstdrag>-----用于访问参数数量文化的函数
<cstdarg>-----用于访问参数数量变化的函数
<cstddef>----用于定义实用的类型和宏
<cstdio>-----用于执行输入和输出
<cstdlib>----用于执行同一操作的不同版本
<string>-----用于处理几种不同的字符串类型
<ctime>------用于在几种不同的时间和日期格式间进行转换
<cwchar>----用于处理宽流(wide stream)和字符串
<cwctype>---用于对宽字符(wide character是)分类
<deque>---(STL)用于定义实现双向队列容器的模板类
<exception>---用于定义控制异常处理的几个函数
<fstream>-----用于定义处理外部文件的几个iostream模板类
<functional>-----(STL)用于定义几个模板,该模板将帮助在<algorithm>和<numeric>中定义的                  模板构造谓词
<iomapip>---- 用于声明一个带有参数的iostreams控制器
<ios>-----用于定义用作大量iostreams类的基类的模板类
<iosfwd>-----用于定义iostreams模板类(在需要定义之前)
<iostream>---用于声明处理标准流的iostreams对象
<istream>---用于定义执行析取操作的模板类
<iterator>----(STL)用于定义帮助定义和管理迭代器的模板
<limits>---用于测试数字类属性
<list>---(STL)用于定义实现list容器的模板类
<locale>----用于定义在iostreams类中控制与特定位置相关的行为的类和模板
<map>------(STL)用于定义实现关联容器的模板类
<memoery>-----(STL)用于定义对不同容器分配和释放内存的模板
<numeric>-----(STL)用于定义实现实用数字函数的模板
<ostream>----用于定义管理字符串容器的iostreamas模板类
<queque>----(STL)用于实现队列容器的模板类
<set>-----(STL)用于定义实现只有唯一元素的关联容器的模板类
<sstream>----用于定义管理字符串容器的iostreams模板类
<stack>-----(STL)用于定义实现堆栈容器的模板类
<stdexcept>----用于定义提交异常的类
<streambuf>----用于定义为iostreams操作分配缓冲区的模板类
<string>------用于定义是实现字符串容器的模板类
<strstream>-----用于定义处理非内存(in-memory)字符系列的iostreams类
<utility>-----(STL)用于定义通用工具的模板
<valarray>----用于定义支持值(value-oriented)数组的类和模板类
<vector>----(STL)用于定义实现向量容器的模板类

标准c++库还包括18个标准C库中的头文件,但其中有些变化。我们暂时不讨论,这些头文件为:

<assert.h>---用于在程序运行时执行断言
<ctype.h>----用于对字符分类
<errno.h>----用于测试用库函数提交的错误代码
<float.h>----用于测试浮点类型属性
<ios646.h>-----用于在IOS646变体字符集中编程
<limits.h>-----用于测试整数类型属性
<locale.h>-----用于适应不同的文化习俗
<math.h>----用于计算常见的数学函数
<setjmp.h>----用于执行非局部的goto语句
<signal.h>----用于控制各种异常情况
<stdrag.h>-----用于访问参数数量变化的函数
<stddef.h>-----用于定义类型和宏
<stdio.h>------用于执行输入和输出
<stdlib.h>------用于执行各种操作
<string.h>-----用于处理字符串
<time.h>-------用于在不同的时间和日期格式之间转换
<wcchar.h>-----用于处理宽流(wide stream)和字符类
<wctype.h>-----用于对宽字符(wide character)分类

 

邵逸儒在2018-02-22 18:04:54追加了内容

万能头

#include<bits/stdc++.h>

 

0
蒋智航
蒋智航
高级天翼
高级天翼

主要是iostream         cstdio

0
杨陈卓
杨陈卓
新手天翼
新手天翼
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<map>
#include<sstream>
#include<queue>
#include<vector>
#include<cstdlib>
#include<stack>
#include<bits/stdc++.h>
#include<cstdlib.h>
#include<windows.h>
#include<conio.h>

 

0
芮奥运
芮奥运
高级光能
高级光能
<algorithm>---(STL)用于定义实现常用、实用算法的大量模板
<bitset>----- 用于定义官位位集合的模板类
<cassert>-----用于在程序执行时执行断言
<cctype>-----用于对字符进行分类
<cerrno>-----用于测试有库函数提交的错误代码
<cfloat>------用于测试浮点类型属性
<cios646>----用于在ISO646变体字符集中编程
<climits>-----用于测试整数类型属性
<clocale>-----用于使程序适应不同的文化风俗
<cmath>———用于计算常用的数学函数
<complex>-----用于定义支持复杂算法的模板类
<csetjmp>-----用于执行非局部的goto语句
<csignal>------用于控制各种异常情况
<cstdrag>-----用于访问参数数量文化的函数
<cstdarg>-----用于访问参数数量变化的函数
<cstddef>----用于定义实用的类型和宏
<cstdio>-----用于执行输入和输出
<cstdlib>----用于执行同一操作的不同版本
<string>-----用于处理几种不同的字符串类型
<ctime>------用于在几种不同的时间和日期格式间进行转换
<cwchar>----用于处理宽流(wide stream)和字符串
<cwctype>---用于对宽字符(wide character是)分类
<deque>---(STL)用于定义实现双向队列容器的模板类
<exception>---用于定义控制异常处理的几个函数
<fstream>-----用于定义处理外部文件的几个iostream模板类
<functional>-----(STL)用于定义几个模板,该模板将帮助在<algorithm>和<numeric>中定义的                  模板构造谓词
<iomapip>---- 用于声明一个带有参数的iostreams控制器
<ios>-----用于定义用作大量iostreams类的基类的模板类
<iosfwd>-----用于定义iostreams模板类(在需要定义之前)
<iostream>---用于声明处理标准流的iostreams对象
<istream>---用于定义执行析取操作的模板类
<iterator>----(STL)用于定义帮助定义和管理迭代器的模板
<limits>---用于测试数字类属性
<list>---(STL)用于定义实现list容器的模板类
<locale>----用于定义在iostreams类中控制与特定位置相关的行为的类和模板
<map>------(STL)用于定义实现关联容器的模板类
<memoery>-----(STL)用于定义对不同容器分配和释放内存的模板
<numeric>-----(STL)用于定义实现实用数字函数的模板
<ostream>----用于定义管理字符串容器的iostreamas模板类
<queque>----(STL)用于实现队列容器的模板类
<set>-----(STL)用于定义实现只有唯一元素的关联容器的模板类
<sstream>----用于定义管理字符串容器的iostreams模板类
<stack>-----(STL)用于定义实现堆栈容器的模板类
<stdexcept>----用于定义提交异常的类
<streambuf>----用于定义为iostreams操作分配缓冲区的模板类
<string>------用于定义是实现字符串容器的模板类
<strstream>-----用于定义处理非内存(in-memory)字符系列的iostreams类
<utility>-----(STL)用于定义通用工具的模板
<valarray>----用于定义支持值(value-oriented)数组的类和模板类
<vector>----(STL)用于定义实现向量容器的模板类
<assert.h>---用于在程序运行时执行断言
<ctype.h>----用于对字符分类
<errno.h>----用于测试用库函数提交的错误代码
<float.h>----用于测试浮点类型属性
<ios646.h>-----用于在IOS646变体字符集中编程
<limits.h>-----用于测试整数类型属性
<locale.h>-----用于适应不同的文化习俗
<math.h>----用于计算常见的数学函数
<setjmp.h>----用于执行非局部的goto语句
<signal.h>----用于控制各种异常情况
<stdrag.h>-----用于访问参数数量变化的函数
<stddef.h>-----用于定义类型和宏
<stdio.h>------用于执行输入和输出
<stdlib.h>------用于执行各种操作
<string.h>-----用于处理字符串
<time.h>-------用于在不同的时间和日期格式之间转换
<wcchar.h>-----用于处理宽流(wide stream)和字符类
<wctype.h>-----用于对宽字符(wide character)分类

 

0
0
马佳滢
马佳滢
新手天翼
新手天翼

    首先C++引入头文件需要在代码文件的开始处中键入 预处理指令 #include 。

        程序的基本编写需要有标准的输入输出作为支持,所以这就要用到 iostream(input/output stream)意思就是 输入输出流,代码如下

#include <iostream>

用法:

int a;
cin>>a;
cout<<a;

给将输入的整数给a赋值,并输入;因为这两个方法是存在于命名空间std下的用的时候还需要在预处理命令后面加入

using namespace std;

        另外 iomanip 头文件为I/O流库提供了一些操控符,例如

#include <iomanip>
cout<<setw(5)<<setprecision(3)<<3.1415<<endl;

将会输出 3.14,该函数setprecision的功能就是 设置浮点小数的位数(包含小数点);函数setw(5)则设置了输出的域宽为5个字符。

        程序的编写当然还离不开数学的计算,此时就需要 cmath 头文件le,

#include <cmath>

里面有一些常用的函数

double fabs(double x);//求绝对值
double sqrt(double x);//求平方根
//一些三角函数
const double PI=3.14159265358979;
double radian=30*PI/180;//求30角度值的弧度值
sin(radian);//0.5
cos(radian);//0.866025
tan(radian);//0.57735

        c的标准类库  cstdlib 中有随机数的函数,在C++中也是适用的,代码

#include <cstdlib>

//随机数函数
void srand(unsigned int seed);//为下面的函数设置种子,不然默认的种子是1,随机数会相同的
int rand();//产生随机数

        此外,还有一些其他的C标准头文件库:

#include <cstdio>
#include <ctime>

等等,更多的资料请参阅 http://www.cppreference.com 这里有很多标准的C++函数的原型,头文件和用法。

我要回答