3.使用批量数据
<vector>的使用
#include <algorithm>
#include <iomanip>#include <ios>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
cout << "plz type in your student's name:";
string name;
cin >> name;
cout << "what's their midterm and final exam grades:";
double midterm, final;
cin >> midterm >> final;
cout << "homework grades";
vector<double> homework;
double x;
while (cin>>x)
{
homework.push_back(x);
}
int size;
size = homework.size();
}