#include using namespace std; int main() { // 1. 入力情報取得. string S; cin >> S; // 2. 助かる確率は? int o = 0, x = 0; for(int i = 0; i < S.size(); i++){ if(S[i] == 'o') o++; else x++; } // 3. 出力 ~ 終了. for(int i = 0; i < S.size(); i++){ char c = S[i]; // 3-1. ネズミの助かる確率を計算. double ans = 100 * o / (o + x + 0.0); cout << fixed; cout << setprecision(13) << ans << endl; // 3-2. 安全な箱 or ネズミ捕りが仕掛けられた箱 の個数を更新. if(c == 'o') o--; if(c == 'x') x--; } return 0; }