删除排序数组的重复数字
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{ int length,a,s,i;
cout<<"请输入数组长度";
cin>>length;
int *p=new int[length];
for(s=0;s<length;s++)
{cout<<"请输入数字";
cin>>p[s];}
for(i=0;i<length-1;i++)
{ if (p[i]==p[i+1])
length--;
}
cout<< "该数组长度为:"<<length << endl;
return 0;
}