Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main() {
- // 长100->a 宽30->b
- int a = 100, b = 30;
- // 周长,面积
- // (a+b) *2
- // ab
- int C = (a+b)*2;
- int S = a*b;
- cout << C << endl;
- cout << S << endl;
- return 0;
- }
- #include<iostream>
- using namespace std;
- int main() {
- // 上底 3 下底 6 高4.5
- int a = 3, b = 6;
- double h = 4.5;
- cout << (a+b)*h/2 << endl;
- return 0;
- }
- #include<iostream>
- using namespace std;
- int main() {
- // 头 -> head 腿->leg
- int head = 50, leg = 160;
- // 鸡
- int chicken = (4*head-leg) / 2;
- // 兔
- int rabbit = head - chicken;
- cout << chicken << " " << rabbit << endl;
- return 0;
- }
- #include<iostream>
- using namespace std;
- int main() {
- // 总数->n 车轮->wheel
- int n = 10, wheel = 26;
- // 自行车 -> b 三轮车 -> t
- int b, t;
- // 自行车
- b = 3*n-wheel;
- // 三轮车
- t = n - b;
- cout << b << " " << t << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement