Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
uses crt;
var a,b,cv,s:longint;
begin
clrscr;
write('a=');readln(a);
write('b=');readln(b);
cv:=(a+b)*2;
s:=a*b;
writeln('chu vi cua hinh chu nhat do la:',cv);
write('dien tich cua hinh chu nhat do la:',s);
readln;
end.
Bài 5:
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<(a+b)*2;
return 0;
}
Câu 2:
#include <bits/stdc++.h>
using namespace std;
long long n,i,j,m;
int main()
{
cin>>n>>m;
for (i=1; i<=n; i++)
{
for (j=1; j<=m; j++)
{
if (i==1 || j==1|| i==n|| j==m) cout<<"*";
else cout<<" ";
}
cout<<endl;
}
return 0;
}
uses crt;
const fi='x.inp';
var f1:text;
a,b:array[1..100]of integer;
i,n:integer;
begin
assign(f1,fi); reset(f1);
n:=0;
while not eof(f1) do
begin
n:=n+1;
readln(f1,a[n],b[n]);
end;
for i:=1 to n do
begin
writeln('Chu vi dong ',i,' la: ',(a[i]+b[i])*2);
writeln('Dien tich dong ',i,' la: ',a[i]*b[i]);
end;
close(f1);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
freopen("hcn.inp","r",stdin);
freopen("hcn.out","w",stdout);
cin>>a>>b;
cout<<(a+b)*2<<endl;
cout<<a*b;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a[10],i,t,dem;
int main()
{
for (i=1; i<=10; i++) cin>>a[i];
t=0;
dem=0;
for (i=1; i<=10; i++)
{
if (a[i]%2==0) t=t+a[i];
else dem++;
}
for (i=1; i<=10; i++) cout<<a[i]<<" ";
cout<<endl;
cout<<t<<endl;
cout<<dem;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a[10],i,n,t1,dem1,s;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++) cout<<a[i]<<" ";
cout<<endl;
t1=0;
dem1=0;
s=1;
for (i=1; i<=n; i++)
{
if (a[i]%2==0) t1+=a[i];
else dem1+=1;
if ((a[i]%2==0) or (a[i]%3==0)) s=s*a[i];
}
cout<<t1<<endl;
cout<<dem1<<endl;
cout<<s;
return 0;
}
long long a,b,dt;
Var a,b:integer;