//?程序文件:1.cpp
#include?<iostream>
using?namespace?std;
void?fun(int?x)
{
??if?(x?<?0)
??{
????cout?<<?‘-‘;????x?=?-x;
??}
??while?(x?!=?0)
??{
????cout?<<?x%10;????x?/=?10;
??}
??cout?<<?endl;
}
void?fun(char?*str)
{
??int?N?=?0;
??while?(str[N]?!=?‘\0’)????N++;
??for?(int?n?=?N-1;?n?>=?0;?n--)
????cout?<<?str[n];
??cout?<<?endl;
}
?
//?程序文件:2.cpp
#include?<iostream>
using?namespace?std;
extern?void?fun(int?x);
extern?void?fun(char?*str);
int?main(?)
{
??fun(?-2015?);
??fun(?“-2015”?);
??return?0;
}
C++程序(共2個文件)。程序的功能是什么?
yuantongxin
2015-11-23 16:02:45