fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int divisores_1700[300];
  5. int divisores_encontrados_1700 = 0;
  6.  
  7. int divisores_57[57];
  8. int divisores_encontrados_57 = 0;
  9. int ax_candidato;
  10. int bx_candidato;
  11.  
  12. int i, j;
  13.  
  14. for (bx_candidato = 1; bx_candidato <= 57; bx_candidato++) {
  15. if (57 % bx_candidato == 0) {
  16. divisores_57[divisores_encontrados_57] = bx_candidato;
  17. divisores_encontrados_57++;
  18. }
  19. }
  20.  
  21. for (ax_candidato = 1; ax_candidato <= 300; ax_candidato++) {
  22. if (1700 % ax_candidato == 0 && 1700/ax_candidato <= 300) {
  23. divisores_1700[divisores_encontrados_1700] = ax_candidato;
  24. divisores_encontrados_1700++;
  25. }
  26. }
  27.  
  28. for (i = 0; i < divisores_encontrados_57; i++) {
  29. for (j = 0; j < divisores_encontrados_1700; j++) {
  30. int a_x, a_y, b_x, b_y;
  31.  
  32. a_x = divisores_1700[j];
  33. a_y = 1700/a_x;
  34.  
  35. b_x = divisores_57[i];
  36. b_y = 57/b_x;
  37.  
  38. printf("(%d/%d) * (%d/%d) == 1700/57\n", a_x, b_x, a_y, b_y);
  39. }
  40. }
  41.  
  42. return 0;
  43. }
  44.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
(10/1) * (170/57) == 1700/57
(17/1) * (100/57) == 1700/57
(20/1) * (85/57) == 1700/57
(25/1) * (68/57) == 1700/57
(34/1) * (50/57) == 1700/57
(50/1) * (34/57) == 1700/57
(68/1) * (25/57) == 1700/57
(85/1) * (20/57) == 1700/57
(100/1) * (17/57) == 1700/57
(170/1) * (10/57) == 1700/57
(10/3) * (170/19) == 1700/57
(17/3) * (100/19) == 1700/57
(20/3) * (85/19) == 1700/57
(25/3) * (68/19) == 1700/57
(34/3) * (50/19) == 1700/57
(50/3) * (34/19) == 1700/57
(68/3) * (25/19) == 1700/57
(85/3) * (20/19) == 1700/57
(100/3) * (17/19) == 1700/57
(170/3) * (10/19) == 1700/57
(10/19) * (170/3) == 1700/57
(17/19) * (100/3) == 1700/57
(20/19) * (85/3) == 1700/57
(25/19) * (68/3) == 1700/57
(34/19) * (50/3) == 1700/57
(50/19) * (34/3) == 1700/57
(68/19) * (25/3) == 1700/57
(85/19) * (20/3) == 1700/57
(100/19) * (17/3) == 1700/57
(170/19) * (10/3) == 1700/57
(10/57) * (170/1) == 1700/57
(17/57) * (100/1) == 1700/57
(20/57) * (85/1) == 1700/57
(25/57) * (68/1) == 1700/57
(34/57) * (50/1) == 1700/57
(50/57) * (34/1) == 1700/57
(68/57) * (25/1) == 1700/57
(85/57) * (20/1) == 1700/57
(100/57) * (17/1) == 1700/57
(170/57) * (10/1) == 1700/57