C/C++掌握技能(一)

  

1、在编译器中输入代码并将其保存为.cpp文件(C语言的文件扩展名.c,但为了使用C++中的一些好用的特性,请把文件扩展名改为C++的.cpp)
2、等价头文件:
#include<stdio.h>和#include<cstdio>
#include<math.h>和#include<cmath>
#include<string.h>和#include<cstring>

 

 

for(int i=1;i<=length-1;i++){
        for(int j=0;j<)length-i;j++){
        if(a[j]>a[j+1]){
            int tmp=a[j];
            a[j]=a[j+1];
            a[j+1]=temp;
        }
    }
}

 

原文地址:https://www.cnblogs.com/King-boy/p/10685115.html