标签:二维数组 使用 sys include ios mes code ace 成绩
#include<iostream>
#include<string>
// 直接调用std空间使用
using namespace std;
int main() {
int grade[3][3] = {
{99,99,99},
{88,88,88},
{77,77,77}
};
string names[3] = { "xiaohu","xiaoming","xiaogou" };
int res = 0;
for (int i = 0; i < sizeof(grade) / sizeof(grade[0]); i++) {
res = 0;
for (int j = 0; j < sizeof(grade[0]) / sizeof(grade[0][0]); j++) {
res += grade[i][j];
}
cout << names[i] << "'s grade -> " << res << endl;
}
system("pause");
return 0;
}
标签:二维数组 使用 sys include ios mes code ace 成绩
原文地址:https://www.cnblogs.com/zpchcbd/p/11840241.html