fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. string g; cin >> g;
  5. if(g == "F") cout << 0.0;
  6. else {
  7. int b = 69 - g[0];
  8. double s = b;
  9. if(g[1] == '+') {
  10. s += 0.3;
  11. } else if(g[1] == '-') {
  12. s -= 0.3;
  13. }
  14. cout << fixed << setprecision(1) << s;
  15. }
  16. }
Success #stdin #stdout 0.01s 5312KB
stdin
A+
stdout
4.3