Home > Back-end >  The c language
The c language

Time:09-29

Keyboard input integer data of 3 * 3 triangle data accumulation and pray

CodePudding user response:

 
Int I, j, sum=0;
//build 3 * 3 array input data
for(i=0; i<3; I++) {
for(j=0; j<3; J++) {
If (i> J)={
The sum +=arr [I] [j];
}
}
}

On the characteristics of the triangle is diagonal when I=j as the boundary, so the i>=j, also is the combined line is more than equal to the column
  • Related