fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. double t, v;
  5. double max = -1e9;
  6. double peak_time = 0;
  7.  
  8. while (scanf("%lf %lf", &t, &v) != EOF) {
  9. if (v > max) {
  10. max = v;
  11. peak_time = t;
  12. }
  13. }
  14.  
  15. printf("ピーク電圧 = %f V\n", max);
  16. printf("ピーク時刻 = %f 秒\n", peak_time);
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 5320KB
stdin
2.83
2.79
2.81
2.95
3.02
.
stdout
ピーク電圧 = 2.950000 V
ピーク時刻 = 2.810000 秒