//#include "stdafx.h"//vc++6.0加上这一行.
#include "stdlib.h"
#include
using namespace std;
int main(void){
int i,j,k,M,S,x,*p;
while(1){
cout << "Please input M(int M>0) & S(int S>0)...\n";
if(cin >> M >> S,M==0 && S==0)
break;
if(M>0 && S>0 ){
if(p=new int[M],p){
for(i=0;i
p[i]=j=0;
k++;
}
cout << "The last one is the No." << (i ? i : M) << endl;
delete [M]p;
}
else{
cout << "Application memory failure...";
exit(0);
}
}
else cout << "Error,redo: ";
}
cout << endl;
return 0;
}