fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. double go = 1.0;
  5. double yon = 1.0;
  6. double ans = 1e19;
  7. int n = 0;
  8.  
  9. while (go + yon < ans) {
  10. go *= 5.0;
  11. yon *= 4.0;
  12. n++;
  13. }
  14.  
  15. printf("5^n+4^nが10^19を超える最小のnは%dです\n", n);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
5^n+4^nが10^19を超える最小のnは28です