编程语言
1.如何将a,b的值进行交换,并且不适用任何中间变量
#include
void first(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
printf("%d %d\n",a,b);
}
void second(int a,int b)
{
a=a^b;
b=a^b;
a=a^b;
printf("...
C/C++中的64位整数(__int64 and long long)
在做ACM题时,经常都会遇到一些比较大的整数。而常用的内置整数类型常常显得太小了:其中long 和 int
范围是[-2^31,2^31),即-2147483648~2147483647。而unsigned范围是[0,2^32)...
C语言标准库函数标准io函数Standard C I/Oclearerr() clears
errorsfclose() close a filefeof() true if at the end-of-fileferror() checks for
a file errorfflush() wri...
wgethttp://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgztar-zxvfPython-2.7.3.tgzcdPython-2.7.3./configuremake;makeinstallcd/usr/binmvpythonpython.b...
http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html
首先大数加法 两个大数相加
string sum(string s1,string s2)
{
if(s1.length()=0;i--,j--)
{
s1[i]=char(s...
#include
#include //malloc需要此头文件
//定义单链表结点结构体
typedef int ElemType;
typedef struct Node
{
ElemType data;
struct Node *next;
}LNode,*LinkList;
//建立一个带头结点的单链表
void Build(LinkList L)
{
...
C++关键字:mutable、volatile、explicit以及__based
mutable关键字
关键字mutable是C++中一个不常用的关键字,他只能用于类的非静态和非常量数据成员我们知道一个对象的状态由该对象的非静态数据成员决定,所以随着数据成员的改变,对像的状态也会随之发生变化!
如果一个类的成员函数被声明为const类型,表示该函数不会改变对象...
const指针 防止指针指向的内容被修改
#include
#include
using namespace std;
struct Elephant{
string name;
Elephant* next;
};
void print_elephants(const Elephant* ptr);
Elephant* get_elephants();
void free_list(c...