?? action.cpp
字號:
#include <iostream>#include <iomanip>#include "Action.h"Action::Action(int index, vector<int> vars) : m_index(index){ m_vars = vars;}void Action::print() const{ cout << "Action: ( "; for (int i=0; i<(int) m_vars.size(); i++) cout << m_vars[i] << " "; cout << ")" << endl;}void Action::print(string &str) const{ str += "Action: ( "; for (int i=0; i<(int) m_vars.size(); i++) { char num[100]; if (i==(int) m_vars.size()-1) sprintf(num,"%d",m_vars[i]); else sprintf(num,"%d, ",m_vars[i]); str += num; } str += " )\n";}int Action::getIndex() const{ return m_index;}int Action::getVar(int index) const{ if (index >= (int) m_vars.size() || index<0) return 0; else return m_vars[index];} /********************************************************************* * (C) Copyright 2006 Albert Ludwigs University Freiburg * Institute of Computer Science * * All rights reserved. Use of this software is permitted for * non-commercial research purposes, and it may be copied only * for that use. All copies must include this copyright message. * This software is made available AS IS, and neither the authors * nor the Albert Ludwigs University Freiburg make any warranty * about the software or its performance. *********************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -