level 5
#include <iostream>
#include <vector>
#include <string>
#include <iterator>
using namespace std;
int main() {
int a = 5;
string b[a] = { "4", "5", "6", "2", "8" };
string *beg = begin(b);
string *last = end(b);
for (; beg != last; ++beg)
cout << *beg <<endl;
2017年03月17日 05点03分
3
level 12
#include <iostream>
//#include <vector>
#include <string>
//#include <iterator>
using namespace std;
int main()
{
const int a = 5; //要是常量
string b[a] = { "4","5","6","2","8" }; //最好用 vector<string>
auto beg = begin(b); //返回的是个迭代器, 不是 string*
auto last = end(b); //同上
for (; beg != last; ++beg)
cout << *beg << endl;
return 0;
}
2017年03月17日 06点03分
4
感谢,按你的做解决了
2017年03月18日 00点03分