有关输入方面的问题
程序全部代码是这样的:
#include "stdio.h"
#include "conio.h"
main()
{
int i,j,a,b;
float score[100][100];
float sum,avg;
for(i=0;i<100;i++)
{
for(j=0;j<100;j++)
{
score[i][j]=0;
}
}
printf("please input studen a:");
scanf("%d",&a);
printf("please input score b:");
scanf("%d",&b);
for(i=0;i<a;i++)
{
for(j=0;j<b;j++)
{
printf("please input %dth studen %dth score:",i+1,j+1);
scanf("%f",&score[i][j]);
}
}
for(i=0;i<a;i++)
{
for(j=0;j<b;j++)
{
printf("%.5f",score[i][j]);
}
printf("\n");
}
//getch();
for(i=0;i<a;i++)
{
sum=0;
for(j=0;j<b;j++)
{
sum+=score[i][j];
}
avg=sum/b;
printf("%dth studen avg is %.5f\n",i+1,avg);
}
printf("Hello, world\n");
getch();
}
但是当用winTC编译器编译运行通过了,就是输入的时候,当把第一个循环输出的语句结束后,屏幕自动就关闭了,用C/C++编译器运行却没有这样的问题,请问各位大虾,这是什么情况呀?
[解决办法]
在WinTC下设置断点,单步调试看什么地方退出程序了??
[解决办法]
应该是编译器的问题吧,编译器不同吧。