在结尾处printf("%s",names[i]);中,编译的时候显示有问题,请问是什么原因?求解!
#include <stdio.h>
#include
using namespace std;
main()
{
int scores[3][3] =
{
{100,100,100},
{90,50,100},
{60,70,80}
};
string names[3] = {"张三","李四","王五"};
for(int i = 0; i<3; i++)
{
int sum = 0;
for(int j = 0; j<3; j++)
{
sum += scores[i][j];
}
printf("%s",names[i]);
printf("的总分为:");
printf("%d\n",sum);
}
}