Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool MaterialDependence(int m1, int m2)
- {
- int w1[5], w2[5];
- for (int i = 0; i < 5; i++)
- {
- w1[i] = ww[m1][i];
- w2[i] = ww[m2][i];
- }
- return (w1[0] + w1[1] + w1[2] + w1[3] + w1[4] < w2[0] + w2[1] + w2[2] + w2[3] + w2[4])
- && (w1[0] < w2[0])
- && (w1[0] + w1[1] < w2[0 + w2[1]])
- && (w1[2] < w2[2])
- && (w1[0] + w1[1] + w1[3] < w2[0] + w2[1] + w2[3])
- && (w1[2] + w1[4] < w2[2] + w2[4]);
- }
- int main()
- {
- int i, j;
- WInit();
- for (int i = 0; i < wcount; i++)
- for (j = 0; j < wcount; j++)
- if (MaterialDependence(i, j))
- printf("%i -> %i are dependent.\n", i, j);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement