fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. double hani = powl(10.0L, 19.0L);
  5. double go = 1.0L;
  6. double yon = 1.0L;
  7. int n = 0;
  8. while (1) {
  9. n++;
  10. go *= 5.0L;
  11. yon *= 4.0L;
  12. if (go + yon > hani) {
  13. printf("n = %d で 5^n + 4^n = %.0Lf + %.0Lf = %.0Lf > 10^19\n",
  14. n, go, yon, go + yon);
  15. break;
  16. }
  17. }
  18. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
n = 28 で 5^n + 4^n = 0 + 0 = nan > 10^19