Skip to content

Commit

Permalink
Add 20374.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Mar 15, 2024
1 parent 013b592 commit a3e34b0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions 20xxx/20374.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <iostream>
#include <string>
using namespace std;

void solve(void) {
long long ans = 0;

string s;
while (cin >> s) {
ans += stoll(s.substr(0, s.length()-3)) * 100 + stoll(s.substr(s.length()-2, 2));
}
cout << ans / 100 << "." << (ans % 100 < 10 ? "0" : "") << ans % 100;
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

solve();
return 0;
}

0 comments on commit a3e34b0

Please sign in to comment.