#include #include using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { //1.C++在2011年,新增了很多字串函數(例如,把字串轉成整數stoi) , //這些函數,被定義在標頭檔內(不是字串物件類別內) //參考API網址:https://www.cplusplus.com/reference/string/ //註記符號: 例如在『stoi()函數的右方寫:c++11,就是2011年新增的函數 //2.Dev c++軟體預設支援的API函數的年份 = 2008年 //修改方法:Tool => Compiler Option => setting => code generation => language standard => iso c++ 2011 //3.string轉換成int: stoi() string a1 = "321"; int i1 = stoi(a1); cout<<"stoi('321') = "<