我使用此代码获取用户输入并验证它,以增加用户钱包中的用户BTC。我需要一些代码的解释,它是如何工作的。代码:
#include <iostream>
using namespace std;
int main()
{
int btc_input, result_btc, btc_validation, btc_validation_1_input, btc_validation_2_input;
result_btc = 0;
btc_validation = 0;
btc_validation_1_input = 0;
btc_validation_2_input = 0;
for (; btc_validation < 3; btc_validation++)
{
cout << "Enter the Value " << (btc_validation + 1) << " + " ;
cin >> btc_input;
cout << "Enter the Value " << (btc_validation + 1) << " + " ;
cin >> btc_input;
btc_validation_1_input == btc_validation + btc_input;
cout << "Enter the Value " << (btc_validation_1_input + 1) << " + " ;
cin >> btc_validation_2_input;
result_btc = btc_validation_1_input + btc_validation_2_input;
result_btc *= btc_validation_2_input;
break;
}
cout << result_btc << '\n';
cout << "Your BTC Wallet is Increased by " << result_btc << " coins " << '\n';
}发布于 2020-04-29 22:25:20
你的代码在任何情况下都不是一个API,而是一个代码,要注意诈骗者。你拥有的代码的工作方式和我将解释的一样,通过编辑和转换你的代码,以最小的形式让你更好地理解。
#include <iostream>
using namespace std;
int main()
{
int btc_input, result_btc, btc_validation;
result_btc = 0;
btc_validation = 0;
for (; btc_validation < 3; btc_validation++)
{
cout << "Enter the number >> [" << btc_validation + 1 << "] " ;
cin >> btc_input;
result_btc += btc_input;
}
cout << (result_btc *= btc_input) << '\n';
cout << "You entered " << result_btc << " numbers " << '\n';
}https://stackoverflow.com/questions/61503154
复制相似问题