Realtion_2.c 656 B

123456789101112131415161718192021222324252627282930313233
  1. #include <stdio.h>
  2. int main() {
  3. int x = 1;
  4. int y = 1;
  5. int lx[11];
  6. int ly[11];
  7. for (x = 1; x <= 10; x++) {
  8. for (y = 1; y <= 10; y++) {
  9. if (y != 0 && (x / y) == 1) {
  10. lx[x] = 1;
  11. } else {
  12. lx[x] = 0;
  13. }
  14. if (y != 0 && (x / y) == 1) {
  15. ly[y] = 1;
  16. } else {
  17. ly[y] = 0;
  18. }
  19. }
  20. }
  21. for (int i = 1; i <= 10; i++) {
  22. printf("%d Liste x \n", lx[i]);
  23. }
  24. for (int i = 1; i <= 10; i++) {
  25. printf("%d Liste y \n", ly[i]);
  26. }
  27. return 0;
  28. }