标签:pac ace pre code style int system class span
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { vector<unsigned> scores; for (decltype(scores.size()) ix = 0; ix < 11; ++ix) { scores.push_back(ix); } //sort(scores.begin(), scores.end()); //for (vector<unsigned>::iterator it = scores.begin(); *it < scores.size(); it++) { // cout<<it //} for (decltype(scores.size()) ix = 0; ix < scores.size()-1;ix+=2 ) { cout << scores[ix] + scores[ix + 1] << ‘ ‘; } if (scores.size() % 2 != 0) { cout << "最后一个" << endl; } system("pause"); }
标签:pac ace pre code style int system class span
原文地址:https://www.cnblogs.com/jingchu/p/10347394.html