fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a, b, c, n;
  5.  
  6. printf("%s\n", "Find A, B, C for [5ABC15 % 999 = 0]");
  7. for (a = 0; a < 10; a++) {
  8. for (b = 0; b < 10; b++) {
  9. for (c = 0; c < 10; c++) {
  10. n = 500015 + (a * 10000) + (b * 1000) + (c * 100);
  11. if (!(n % 999)) {
  12. printf("A=%d, B=%d, C=%d\n", a, b, c);
  13. }
  14. }
  15. }
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 4196KB
stdin
Standard input is empty
stdout
Find A, B, C for [5ABC15 % 999 = 0]
A=8, B=4, C=4