#23184: 兩種方法


20071124 (107-31范育綸)

學校 : 臺北市私立延平高級中學
編號 : 128870
來源 : [122.99.19.83]
最後登入時間 :
2024-04-03 00:59:51
a862. 2. My Dear Friend VIR -- HP CodeWars2010 | From: [203.72.178.252] | 發表日期 : 2020-10-28 17:30

第1種

#include <bits/stdc++.h>

  using namespace std;

   

  int main() {

  double v, r;

  while(cin>>v>>r)

{

cout<<fixed<<setprecision(4)<<v/r*1000<<endl;

  return 0;

  }

第2種

#include <bits/stdc++.h>

       using namespace std;

        

       int main() {

       double V, R;

       while (scanf("%lf %lf", &V, &R) == 2)

       printf("%.4lf\n", V * 1000 / R);

       return 0;

       }

 
ZeroJudge Forum