qBasik:
INPUT A
INPUT B
IF A>0 AND B>0
THEN
S=A+B
PRINT S
PRINT " "
S=A*B
ELSE
S=A-B
S=A/B
END
C/C++ :
#include <cstdlib>#include <iostream>using namespace std;int main(){
int a,b;
cin>>a;
cin>>b;
if(a>0 && b>0)
{
cout<<a+b<<" "<<a*b<<endl;
}
else
float c=a/b;
cout<<a-b<<" "<<c<<endl;
} system("PAUSE"); return 0;}
Pascal ABC
Var a,b:real;
Begin
Read(a,b);
If (a>0) and (b>0) then write(a+b,' ',a*b)
Write(a-b,' ',a/b);
End.
qBasik:
INPUT A
INPUT B
IF A>0 AND B>0
THEN
S=A+B
PRINT S
PRINT " "
S=A*B
PRINT S
ELSE
S=A-B
PRINT S
PRINT " "
S=A/B
PRINT S
END
C/C++ :
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a;
cin>>b;
if(a>0 && b>0)
{
cout<<a+b<<" "<<a*b<<endl;
}
else
{
float c=a/b;
cout<<a-b<<" "<<c<<endl;
}
system("PAUSE");
return 0;
}
Pascal ABC
Var a,b:real;
Begin
Read(a,b);
If (a>0) and (b>0) then write(a+b,' ',a*b)
ELSE
Write(a-b,' ',a/b);
End.