#include <iostream>
#include <algorithm>//#include <vector>using namespace std;int main () {
int myints[] = {32,71,12,45,26,67,53,68}; int l=sizeof(myints)/sizeof(myints[0]);//数组长度 int N=100; sort (myints, myints+l); int myints2 [8]; for(int i=0;i<l;i++) { // cout<<myints[i]<<" "; myints2[i]=N-myints[i];// cout<<myints2[i]<<" "; } int start1=0,start2=l-1;//从数组1的第一个元素和数组2的最后一个元素开始比较 while((start1!=(l-1))||(start2!=0))//循环到数组1的最后一个元素或者数组2的第一个元素 { if(myints[start1]==myints2[start2]) {cout<<myints[start1]<<"+"<<myints[start2]<<"="<<N<<endl; break; } else if(myints[start1]<myints2[start2]) ++start1; else --start2; } return 0;}