1 solutions

  • 0
    @ 2025-11-5 15:09:23

    C++ :

    #include<iostream>
    using namespace std;
    int main()
    {
    	double a,b,c,e,f,d;
    	cin>>a;
    	cin>>b;
    	if(a==0||b==0)
    	{
    		cout<<"error"<<endl;
    		return 0;
    	}
    	c=a+b;
    	c=c*2;
    	d=a*b;
    	cout<<d<<endl<<c<<".00";
    	
    }
    

    Pascal :

    var
      a,b:real;
    begin
       readln(a,b);
       if (a>0) and (b>0) then
         begin
           writeln(a*b:0:2);
           writeln((a+b)*2:0:2);
         end
         else
         writeln('error');
         end.
    
    • 1

    Information

    ID
    16453
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By