1.定义个数组并初始化,然后将数组倒置,并显示倒置前和倒置后的结果。

 #include <iostream>
#include <stdio.h>
using namespace std; void main()
{
#pragma region 第一题
int iNum[] = { ,,,,, };
for (int a=;a<;++a)
{
cout << iNum[a];
}
cout << endl;
int *a,*b,*c;//*引用操作符 指针
for (int d = ; d < ; d++)
{
a = &iNum[d];//&取地址符 指针
b = &iNum[ - d];
*a ^= *b;//按位异或赋值
*b ^= *a;
*a ^= *b;
}
for (int a = ; a < ; a++)
{
cout << iNum[a];
}
cout << endl;
#pragma endregion

c++ exercises的更多相关文章

  1. [Bhatia.Matrix Analysis.Solutions to Exercises and Problems]Contents

    I find it may cost me so much time in doing such solutions to exercises and problems....I am sorry t ...

  2. 46 Simple Python Exercises (前20道题)

    46 Simple Python Exercises This is version 0.45 of a collection of simple Python exercises construct ...

  3. State Estimation for Robotics (Tim Barfoot) exercises Answers

    Here are some exercises answers for State Estimation for Robotics, which I did in June, 2017. The bo ...

  4. Linux command line exercises for NGS data processing

    by Umer Zeeshan Ijaz The purpose of this tutorial is to introduce students to the frequently used to ...

  5. 100 numpy exercises

    100 numpy exercises A joint effort of the numpy community The goal is both to offer a quick referenc ...

  6. 46 Simple Python Exercises-Very simple exercises

    46 Simple Python Exercises-Very simple exercises 4.Write a function that takes a character (i.e. a s ...

  7. Exercises for IN1900

    Exercises for IN1900October 14, 2019PrefaceThis document contains a number of programming exercises ...

  8. Coroutine 练习 1 - Coroutine Exercises 1

    Coroutine 练习 1 - Coroutine Exercises 1 字典中为动词 “to yield” 给出了两个释义:产出和让步.对于 Python 生成器中的 yield 来 说,这两个 ...

  9. Proofs without Words:Exercises in Visual Thinking(v.1 and v.2)

    下面是手画的和拍的一些图片,出自标题中的那两本书,在图书馆草草浏览了半个小时,就把一眼能看出来的摘到这里了,再复杂一些的感觉违背了无字证明的初衷了,就没有摘录: 勾股定理: 希波克拉底定理: 无限步三 ...

  10. Exercises - Kangaroo

    Write a definition for a class named Kangaroo with the following methods: An __init__ method that in ...

随机推荐

  1. CentOS配置服务开机自启

    本例子以nginx作为举例: CentOS7中 以systemctl 替代了chkconfig 进行服务的管理, 默认在CentOS6 中控制服务开机自启,是在vim /etc/rc.d/rc.loc ...

  2. 【LeetCode】75-颜色分类

    题目描述 给定一个包含红色.白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色.白色.蓝色顺序排列. 此题中,我们使用整数 0. 1 和 2 分别表示红色.白色 ...

  3. C语言实现二级指针表示字符串数组

    头文件: #include<stdlib.h> #include<stdio.h> #include<string.h> 函数原型: char ** createB ...

  4. Redis真的那么好用吗

    Redis是什么 Redis是一个开源的底层使用C语言编写的key-value存储数据库.可用于缓存.事件发布订阅.高速队列等场景.而且支持丰富的数据类型:string(字符串).hash(哈希).l ...

  5. spring boot不使用resoures而是建立一个conf

    一般配置文件都是放在rsources下,有时候我们不想放在这里,而是直接放在根目录下,那么我们应该怎么做呢? 1.在pom.xml中添加: <build> <!--<final ...

  6. Python的6种运算符(日记)

    学习了许久的Python,我单独总结出了Python中比较常见的6种运算符,感觉略有不全,希望大伙可以一起讨论与研究Python! 一.算术运算符 加 减 - 乘 * 除 / 取余 % 取整 // 异 ...

  7. iOS代码混淆

    混淆原理 代码编译阶段将符号(方法名.属性名等)替换成随机生成的字符串 长话短说,直接上步骤. 混淆集成步骤 步骤一.创建shell文件(confuse.sh)并配置相应的运行环境. 在项目根目录下新 ...

  8. Mybatis 分页查询

    该篇博客记录采用pagehelper分页插件实现Mybatis分页功能 一.依赖 pom.xml <!-- pagehelper --> <dependency> <gr ...

  9. java反射原理,应用

    java类的加载过程 调用java命令运行程序时,该命令会启动一条java虚拟机进程,该程序的所有线程都会运行在这个虚拟机进程里面.程序运行产生的线程.变量都处于这个进程,共同使用该JVM进程的内存区 ...

  10. 虚拟化(一) -VMware产品介绍

    https://www.cnblogs.com/zhrngM/p/9547928.html 由于公司最近在做虚拟化监控,因此就需要把虚拟化方面的知识给学习总结一下,对于虚拟化的概念,摘自百度百科,如下 ...