|
|
вернуться в форумwhy i got compilation error ( code included ) please help me Послано Hany 4 сен 2003 00:45 #include<stdio.h> #include<iostream.h> #include<string> using namespace std; struct st { int name; string num; }; main() { int n; cin>>n; st *arr=new st[n]; string *arr2=new string[(n/2)+1]; string temp; int temp2; int count=0; int count2=0; for(int i=0;i<n;i++) { cin>>temp; if(temp=="PUSH") { cin>>arr[count].name; cin>>arr[count].num; count++; } else if(temp=="POP") { cin>>temp2; for(int j=count-1;j>=0;j--) { if(arr[j].name==temp2) { arr2[count2]=arr[j].num; arr[j].name=-1; count2++; break; } } } } for(int i=0;i<count2;i++) cout<<arr2[i]<<endl; } |
|
|