|
|
вернуться в форумPlease, help me. Why Compilation Error in C++ ? #include <iostream.h> const int max=100000; using namespace std; int main() { int Stack[max]; long Value[max]; long n; long m; char c; int t; char k; cin>>n; while (n > 0) { cin>>c>>c; if (c == 'U') { cin>>k>>k; m++; cin>>Stack[m]>>Value[m]; } else { cin>>k; cin>>t; for (long i = m; i>=1; i--) if (Stack[i] == t) { Stack[i] = 0; cout<<Value[i]<<endl; break; } } n--; } return 0; } Edited by author 19.07.2005 17:01 I corrected your code: (+) Послано qwerty 19 июл 2005 18:32 #include <iostream> #define max 100000 using namespace std; int main() { int Stack[max]; long Value[max]; long n; long m; char c; int t; char k; cin>>n; while (n > 0) { cin>>c>>c; if (c == 'U') { cin>>k>>k; m++; cin>>Stack[m]>>Value[m]; } else { cin>>k; cin>>t; for (long i = m; i>=1; i--) if (Stack[i] == t) { Stack[i] = 0; cout<<Value[i]<<endl; break; } } n--; } return 0; } Thank you very much ! I don't know C, C++ much. I used Dev-C++ to write my error code -> Compilation Success but Submit with CE. What programming do you use to submit with C++? Thanks. Edited by author 20.07.2005 16:35 Thank you very much ! I don't know C, C++ much. I used Dev-C++ to write my error code -> Compilation Success but Submit with CE. What programming do you use to submit with C++? Thanks. I use Dev-Cpp and Borland C++ (-) Послано qwerty 20 июл 2005 22:36 |
|
|