标签:include 程序员 cccccc c语言 color
#include <stdio.h> /* a = 10 b = 11 交换之后 a -> 11 b -> 10 1.利用第三方变量(工作,掌握) int temp = a; a = b; b = temp; 2.不利用第三方变量(面试) a = b - a; b = b - a; a = b + a; */ int main() { int a = 10; int b = 11; /* int temp = a; a = b; b = temp; */ a = b - a; b = b - a; a = b + a; printf("a=%d, b=%d\n", a, b); //a=11, b=10 return 0; }
标签:include 程序员 cccccc c语言 color
原文地址:http://putongren.blog.51cto.com/9086263/1626202