# 西式稀釋稀世珍寶 https://neoj.sprout.tw/problem/800/ ### Problem Description 最近很流行什麼西式來、稀釋去的,但大 127 常常不知道要怎麼稀釋神秘的$x\%$ 的溶液A變成$y\%$的溶液B。你能幫他寫一個程式計算嗎? 請假設: + 體積具有加成性,即 a $ml$ 的溶液A加上 b $ml$ 的水將會變成 a+b $ml$。 I/O Format ### Input 輸入的第一行有兩個整數,x 以及 y。 保證 $0<y≤x≤100$ ### Output 請輸出一個整數,代表若要 1 公升的溶液B,需要多少 **毫升** 的溶液A? 請無條件捨去到整數 ### Sample I/O #### Sample Input 1 ``` 95 75 ``` #### Sample Output 1 ``` 789 ``` ### Hint 出題者化學都忘得差不多了,不要跟他一樣 QQ C/C++ 中,如果直接將兩個整數相除的行為就像直接對他們 做除法後無條件捨去。 輸出後記要加上行尾換行。 # Code ```cpp #include <iostream> using namespace std; int main(){ int x, y; cin >> x >> y; cout << y * 1000 / x << endl; return 0; }
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up