1e89760ddc
* gcc.misc-tests/acker1.c: Report failure. Use return from main, not exit. Include stdio.h. * gcc.misc-tests/dg-11.c: Remove anchors from regexp. * gcc.misc-tests/dg-12.c: Likewise. * gcc.misc-tests/dg-5.c: Likewise. * gcc.misc-tests/dg-6.c: Likewise. * gcc.misc-tests/dg-7.c: Prototype abort. * gcc.misc-tests/dg-9.c: Adjust error-message regexps. * gcc.misc-tests/dhry.h: Include stdlib.h and string.h. * gcc.misc-tests/matrix1.c: Report failure. Use return from main, not exit. * gcc.misc-tests/sieve.c: Use return from main, not exit. * gcc.misc-tests/sort2.c: Use return from main, not exit. From-SVN: r34763
47 lines
1013 B
C
47 lines
1013 B
C
/* Matrix operations */
|
|
|
|
#define BOUND 100
|
|
|
|
int a[BOUND][BOUND],b[BOUND][BOUND],c[BOUND][BOUND];
|
|
|
|
main()
|
|
{
|
|
int i,j,k;
|
|
|
|
|
|
|
|
for (i=0; i<BOUND; i++)
|
|
{
|
|
for (j=0; j<BOUND; j++)
|
|
{
|
|
a[i][j] = 1;
|
|
b[i][j] = 1;
|
|
}
|
|
}
|
|
for (i=0; i<BOUND; i++)
|
|
{
|
|
for (j=0; j<BOUND; j++)
|
|
{
|
|
c[i][j] = 0;
|
|
for (k=0; k<BOUND; k++)
|
|
{
|
|
c[i][j] = c[i][j] + a[i][k] * b[k][j];
|
|
}
|
|
}
|
|
}
|
|
for (i=0; i<BOUND; i++)
|
|
{
|
|
for (j=0; j<BOUND; j++)
|
|
{
|
|
if (c[i][j] != BOUND)
|
|
{
|
|
puts("ERROR");
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
i=5;
|
|
|
|
return 0;
|
|
}
|