P4413
lihongyi0822 · · 题解
因为:(R1+R2)/2=S;
所以反推:2S=(R1+R2),R2=2S-R1。
那这样,题目就很简单了;
#include<iostream>
using namespace std;
int main()
{
int R1,S;
cin >> R1 >> S;
cout << 2*S-R1 << endl;
return 0;
}
lihongyi0822 · · 题解
因为:(R1+R2)/2=S;
所以反推:2S=(R1+R2),R2=2S-R1。
那这样,题目就很简单了;
#include<iostream>
using namespace std;
int main()
{
int R1,S;
cin >> R1 >> S;
cout << 2*S-R1 << endl;
return 0;
}