public static void main(String[] args) {int a = 1;int b = 2;//第一种/*int c=a;a=b;b=c;*///第二种:异或运算a = a ^ b;b = a ^ b;a = a ^ b;System.out.println("a=" + a);System.out.println("b=" + b);}

int a=1;int b=2;a与b互相交换的几种方式相关推荐

  1. linux longlong大小,Linux基本数据类型大小——int,char,long int,long long int

    转自: http://blog.163.com/zheng_he_xiang/blog/static/186505326201110272018548/ 在Linux操作系统下使用GCC进行编程,目前 ...

  2. const int * 、int * const、int const* 、const int a(){ } 和int a()const { }的区别和联系

    前言:很多人都把const int * .int * const.int const* 的区别和联系搞混,我自己在学习C++的过程中,也经常性          弄不 清楚,今天特意总结一下,作为学习 ...

  3. 喜闻乐见的const int *p、int* const p、const int* const p

    不废话直接代码示例: 1 void f(const int *p) { 2 3 int b = 10; 4 5 *p = 10; // error 6 7 p = &b; // fine 8 ...

  4. int(1) 和 int(10) 有什么区别?资深开发竟然分不清!

    欢迎关注方志朋的博客,回复"666"获面试宝典 困惑 最近遇到个问题,有个表的要加个user_id字段,user_id字段可能很大,于是我提mysql工单alter table x ...

  5. int(1) 和 int(10) 的区别?很多老程序都理解错了!

    欢迎关注方志朋的博客,回复"666"获面试宝典 最近开发遇到一个问题,涉及到了int(1) 和 int(10) 有什么区别?三年老开发也不知道,于是自己上网 google 研究了下 ...

  6. int(1) 和 int(10) 有什么区别?资深开发竟然都理解错了!

    文章来源:https://sourl.cn/ZVQP6t 困 惑 最近遇到个问题,有个表的要加个user_id字段,user_id字段可能很大,于是我提mysql工单alter table xxx A ...

  7. 2020-09-21C++学习笔记之与C语言区别和加强——四种const意义(const int a; int const b; const int *c; int * const d)

    2020-09-21C++学习笔记(const int a; int const b; const int *c; int * const d) 这两天在上课更新晚了. 1.C/C++中的const ...

  8. const int *,const int * const和int const *有什么区别?

    我总是搞砸了如何正确使用<code>const int* , const int * const和int const * . 是否有一组规则定义您可以做什么和不能做什么? 我想知道在分配, ...

  9. int*p[ ]与int(*p)[ ]的不同

    举例说明: 1)int* p[2] 是一个指向int型的指针数组,即:p是包含两个元素的指针数组,指针指向的是int型. 可以这样来用: #include <iostream> using ...

最新文章

  1. 页面 table 可编辑的实现
  2. Velocity配置优化
  3. cassandra框架模型之一——Colum排序,分区策略 Token,Partitioner bloom-filter,HASH
  4. 如何在dreamwaver中连接数据库
  5. dbnull和null_NULL和DBNull的区别分析
  6. Spring—注解开发
  7. Android文本框实现搜索和清空效果
  8. 基于JAVA+SpringBoot+Mybatis+MYSQL的工资管理系统
  9. 02.规划过程组表格-需求跟踪矩阵
  10. Best Practices for AWS Security Using CloudCheckr
  11. Appium - WebView測试(Android)
  12. 区块链 以太坊 虚拟机 EVM 为什么256条指令
  13. python命令行参数作用_python中命令行参数和os模块常用函数
  14. shell以分号结尾_linux shell 各种分号,括号使用方法总结
  15. 2021年「通信安全员」通用基础及岗位技能(通信安全员)考试资料
  16. 蓝桥杯 算法训练 印章
  17. git clone报错:could not read Username for ‘http://xxx.com‘: Device not configured
  18. 云计算基础概念——Iaas、PaaS、SaaS
  19. 我发的文章是怎么到你手机上的?计算机网络基础(一)
  20. cips铁路系统服务器,编组站综合自动化系统(CIPS)

热门文章

  1. C++基础入门知识:C++命名空间(名字空间)详解
  2. 程序化交易如何影响A股?
  3. 树莓派进阶之路 (038) - P2P 文件下载机
  4. 今夜,整个中国零售业集体失眠!
  5. 读书笔记第一篇:知乎高赞回答
  6. 悟空crm php 部署,悟空crm开源版本环境搭建
  7. 2023第九届中国国际养老服务业博览会5月5日在北京召开
  8. 如何计算 R 中 Z 分数的 P 值
  9. 有了这套flexible.js 移动端自适应方案,你就能在移动端的来去自如, (*^__^*)
  10. 大数据在金融领域的应用案例解析