top1编程
← 返回题目
题解

【入门】求长方形的周长和面积

1 条题解

  • 0
    @ 2026-7-28 22:09:18
    #include <iostream>
    using namespace std;
    int main()
    {
    	int a,b,c,s;
    	cin>>a>>b;
    	c=(a+b)*2;
    	s=a*b;
    	cout<<c<<endl<<s;
    	return 0;
    }
    
    • 1