viết chương trình in ra màn hình ngôi sao được viết bằng dấu *
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.
![](https://rs.olm.vn/images/avt/0.png?1311)
![](https://rs.olm.vn/images/avt/0.png?1311)
Uses crt;
Var dai,rong:integer;
Procedure Nhap(Var dai:integer;rong:integer);
Begin
Write('Chieu dai: ');readln(dai);
Write('Chieu rong: ');readln(rong);
End;
Procedure Ve(var dai:integer;rong:integer);
var i,j:integer;
Begin
for i:= 1 to dai do write('*');writeln;
For i:= 1 to rong-2 do
Begin
Write('*');
for j:=1 to dai-2 do write(' ');
writeln('*');
end;
for i:= 1 to dai do write('*');
End;
Begin
clrscr;
Nhap(dai,rong);
Ve(dai,rong);
readln;
End.
![](https://rs.olm.vn/images/avt/0.png?1311)
c1:
#include <bits/stdc++.h>
using namespace std;
long long i,n,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++) s=s*i;
cout<<s;
return 0;
}
Câu 2:
#include <bits/stdc++.h>
using namespace std;
long long i,n,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++) if (i%2==0) s=s*i;
cout<<s;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var st:string;
i,d,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
dem:=0;
for i:=1 to d do
if st[i]=#32 then inc(dem);
writeln(dem);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
program bang_cuu_chuong;
uses crt;
var n,tich,i:integer;
begin
clrscr;
n:=2;i:=1;
while n<=9 do
begin
while i<=10 do
begin
tich:=n*i;
writeln(n,' x ',i,' = ',tich);
i:=i+1;
end;
n:=n+1;i:=1;
end;
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
long long i;
int main()
{
for (i=1; i<=10; i++)
cout<<"2*"<<i<<"="<<2*i<<endl;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
Var a: string;
i, Dem: integer;
Begin
writeln(‘nhap xau:’);
Readln(a);
Dem:=0;
For i:=1 to length(a) do
If a[i] =’ ‘ then
Dem:= Dem+1;
Writeln(Dem);
Readln
End.
![](https://rs.olm.vn/images/avt/0.png?1311)
Uses crt;
var i,n: integer;
begin clrscr;
i:=12345;
while(i<>0) do begin
n:=i mod 10; write(n,' ');
i:=i div 10;
end;
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
Câu 1:
#include <bits/stdc++.h>
using namespace std;
double a,b,c;
int main()
{
cin>>a>>b>>c;
cout<<fixed<<setprecision(2)<<(a+b+c)/3;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int i,n;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cout<<"*";
return 0;
}