数组初始化的多种方式
#include<iostream>
#include<string>
using namespace std;
int main(){
int enemHp=100;
//int enemyHPArray[10]={100,90,80,12,12,12,12,12,12,20};
//int enemyHPArray[]={100,90,80,12,12,12,12,12,12,20};
//int enemyHPArray[10]={100,90,80,12};
int enemyHPArray[10]={100,90,80,12,12,12,12,12,12,12,12,20};
//cout<<enemyHPArray[0]<<endl;
//cout<<enemyHPArray[9]<<endl;
enemyHPArray[3]=120;
int totalHp=0;
for(int i=0;i<10;i++){
totalHp+=enemyHPArray[i];
}
cout<<totalHp<<endl;
string str;
cin>>str;
return 0;
}