fork download
  1. #include <stdio.h>
  2.  
  3. #define N 100
  4. int main() {
  5. double t[N],v[N];
  6. int i=0;
  7. while(scanf("%lf,%lf",&t[i],&v[i])==2&&i<N){
  8. i++;
  9. }
  10. printf("No.\t時間[s]\t電位[v]\n");
  11. int n=1;
  12. for(int j=1;j<i-1;j++){
  13. if(v[j]>v[j-1]&&v[j]>v[j+1]){
  14. printf("%d\t%lf\t%lf\n",n++,t[j],v[j]);
  15. }
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
No.	時間[s]	電位[v]