/*使用auto关键字,需要先赋初值,auto关键字是会根据初值来判断类型*/ auto i = 5; auto j = 10; cout << "auto i = 5" << " i type:" << typeid(i).name() << endl << "auto j = 10" << " j type:" << typeid(j).name() << endl; cout << "i + j = " << i + j << endl; auto a = "Hello World!"; cout << "auto a = Hello World!" << endl; cout << "a type:" << typeid(a).name() << endl; auto b = false; cout << "auto b = false" << endl; cout << "b type:" << typeid(b).name() << endl;