[求助]程序没一点问题,怎么就是不出结果,我老师也看不出来!
#include <iostream.h>#define ROW 3
#define COL 4
void main()
{int b[ROW][COL],i,j,r1=0,r2=0,r3=0;
for(i=0;i<=ROW;i++)
for(j=0;j<=COL;j++)
{b[i][j]=3*i+2*j-6;
while(i==1)
{r1+=b[i][j];}
while(j==4)
{r2+=b[i][j];}
while(i==j)
{if(b[i][j]<0) r3++;}}
cout<<r1<<endl;
cout<<r2/4<<endl;
cout<<r3;}