// 101_325.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
vector<unsigned> scores(11, 0);
unsigned grade;
auto beg = scores.begin();
auto end = scores.end();
while (cin >> grade)
{
if (grade <= 100)
(*(beg + grade / 10))++;//写成++*就不用再后面加括号了,*(beg + grade / 10)++没有括号是不对的
}
for(auto i=beg;i!=end;i++)
{
cout << *i << " ";
}
cout << endl;
system("pause");
return 0;
}
//
#include "stdafx.h"
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
vector<unsigned> scores(11, 0);
unsigned grade;
auto beg = scores.begin();
auto end = scores.end();
while (cin >> grade)
{
if (grade <= 100)
(*(beg + grade / 10))++;//写成++*就不用再后面加括号了,*(beg + grade / 10)++没有括号是不对的
}
for(auto i=beg;i!=end;i++)
{
cout << *i << " ";
}
cout << endl;
system("pause");
return 0;
}