intro35.cpp

来自「hello everybody. good lucky to you」· C++ 代码 · 共 23 行

CPP
23
字号
//INTRO35.CPP--Example from Chapter 3, "An Introduction to C++"

#include <iostream.h>

void swap(int *, int *);   // This is swap's prototype

int main()
{
	int x = 5, y = 7;
	swap(&x, &y);
	cout << "\n x is now "<< x << " and y is now " << y << '\n';

	return 0;
}

void swap(int *a, int *b)    // swap is actually defined here
{
	int temp;
	temp = *a;
	*a = *b;
	*b = temp;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?