Cau 2:
var a,b,c,d:integer;
begin
read(a);
read(b);
read(c);
read(d);
write((a+b+c+d)/4);
readln;
end.
Cau 3:
var a,b:integer;
begin
read(a);
read(b);
writeln(b,' ',a);
a:=b;
b:=a;
write(a,' ',b);
readln;
end.
Nếu là chương trình C++ thì làm như này:
#include<iostream>
using namespace std;
int main()
{
float a,b,c,d;
cout<<"Nhap a";
cin>>a;
cout<<"Nhap b";
cin>>b;
cout<<"Nhap c";
cin>>c;
cout<<"Nhap d";
cin>>d;
cout<<"Trung binh cong cua a,b,c,d la=";
cout<<(a+b+c+d)/4;
return 0;
}