fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. double maxt1, maxv1;
  6. double maxt2, maxv2;
  7. double maxt3, maxv3;
  8.  
  9. if (scanf("%lf,%lf", &maxt1, &maxv1) != 2)
  10. return 0;
  11. if (scanf("%lf,%lf", &maxt2, &maxv2) != 2)
  12. return 0;
  13.  
  14. while (scanf("%lf,%lf", &maxt3, &maxv3) == 2) {
  15.  
  16. if (maxv2 > maxv1 && maxv2 > maxv3) {
  17. printf("最大値:%lf\n時刻:%lf\n", maxv2, maxt2);
  18. }
  19.  
  20. maxt1 = maxt2;
  21. maxv1 = maxv2;
  22. maxt2 = maxt3;
  23. maxv2 = maxv3;
  24. }
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty