?? reverse.cpp
字號:
#if !defined( __STACK_H )
#include <Stack.h>
#endif // __STACK_H
#if !defined( __STRNG_H )
#include <Strng.h>
#endif // __STRNG_H
#ifndef __IOSTREAM_H
#include <iostream.h>
#endif
int main()
{
Stack theStack;
String reverse("reverse");
cout << "\nEnter some strings. Reverse will collect the strings\n";
cout << "for you until you enter the string \"reverse\". Reverse\n";
cout << "will then print out the strings you have entered, but in\n";
cout << "reverse order. Begin entering strings now.\n";
for(;;)
{
char inputString[255];
cin >> inputString;
String& newString = *( new String( inputString ) );
if( newString != reverse )
{
theStack.push( newString );
}
else
{
break;
}
}
cout << "\nThe strings you entered (if any) are:\n";
while( !(theStack.isEmpty()) )
{
Object& oldString = theStack.pop();
cout << oldString << "\n";
delete &oldString;
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -