同样的代码在dve c++就可以运行,但是在visual studio2017就不能,为什么?就算我加了stdfax。h还是不行
#include<stdio.h>voidmain(){floatscore[3][2],average[3],temp;charinfo[2][20]={"Cprogr...
#include<stdio.h>
void main()
{
float score[3][2], average[3], temp;
char info[2][20] = { "C programming","English" };
int i, j;
for (i = 0; i < 3; i++)
{
printf("NO:%d\n", i+1);
for (j = 0; j < 2; j++)
{
printf("%s", info[j]);
scanf("%f", &score[i][j]);
}
}
for (i = 0; i < 2; i++)
{
temp = 0;
for (j = 0; j < 3; j++)
temp += score[j][i];
average[i] = temp / 3;
printf("%s:%.2f\n", info[i], average[i]);
} 展开
void main()
{
float score[3][2], average[3], temp;
char info[2][20] = { "C programming","English" };
int i, j;
for (i = 0; i < 3; i++)
{
printf("NO:%d\n", i+1);
for (j = 0; j < 2; j++)
{
printf("%s", info[j]);
scanf("%f", &score[i][j]);
}
}
for (i = 0; i < 2; i++)
{
temp = 0;
for (j = 0; j < 3; j++)
temp += score[j][i];
average[i] = temp / 3;
printf("%s:%.2f\n", info[i], average[i]);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询