fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. double v0;//初速
  5. double a;//加速度
  6. double t;//時間
  7. double x;//移動距離
  8.  
  9. printf("初速,加速度,時間を入力してください\n");
  10. scanf("%lf %lf %lf",&v0,&a,&t);
  11.  
  12. x=v0*t+a*t*t/2;
  13.  
  14. printf("移動距離:%f\n",x);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5508KB
stdin
Standard input is empty
stdout
初速,加速度,時間を入力してください
移動距離:0.000000