程序改错题,
问题描述:
程序改错题,
//实验二(1)
#include
#include
int main( )
/* Pre:The user supplies an integer n and n decimal numbers.
Post:The numbers are printed in reverse order.
Uses:The STL class stack and its methods */
{
\x05int n;
\x05double item;
\x05stack numbers; // declares and initializes a stack of numbers
\x05cout item;
\x05\x05numbers.push(item);
\x05}
\x05cout
答
#include
#include
using namespace std;
int main( )
/* Pre:The user supplies an integer n and n decimal numbers.
Post:The numbers are printed in reverse order.
Uses:The STL class stack and its methods */
{
\x05int n;
\x05double item;
\x05stack numbers; // declares and initializes a stack of numbers
\x05cout item;
\x05\x05numbers.push(item);
\x05}
\x05cout