程序改错题,//实验二(1)#include #includeint 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 nu

来源:学生作业学帮网 编辑:学帮网 时间:2024/05/15 19:24:29

程序改错题,
//实验二(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