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 i,j,m:integer;
t:longint;
a:array[1..100,1..100]of integer;
begin
clrscr;
write('nhap m:');readln(m);
for i:=1 to m do
for j:=1 to m do
begin
write('a[',i,',',j,']=');readln(a[i,j]);
end;
clrscr;
writeln('ma tran da nhap la:');
for i:=1 to m do
begin
for j:=1 to m do
write(a[i,j]:5);writeln;
end;
i:=1;j:=1;
while i<=m do
begin
t:=t+a[i,j];
inc(i);inc(j);
end;
writeln('tong cac phan tu nam tren duong cheo chinh la: ',t);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double a,cv,dt;
int main()
{
cin>>a;
cv=a*4;
dt=a*a;
cout<<fixed<<setprecision(2)<<cv<<endl;
cout<<fixed<<setprecision(2)<<dt;
return 0;
}
uses crt;
var a:array[1..1000]of integer;
n,i,k,min,vt:integer;
begin
clrscr;
write('Nhap n='); readln(n);
if n=0 then writeln('Moi ban nhap lai')
else begin
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n do
write(a[i]:4);
writeln;
min:=a[1];
vt:=1;
for i:=1 to n do
if min>a[i] then
begin
min:=a[i];
vt:=i;
end;
writeln('So nho nhat la: ',min,' tai vi tri: ',vt);
write('Nhap k='); readln(k);
for i:=1 to n do
if i<>k then write(a[i]:4);
end;
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int n,x,i,cnt,res;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin>>n>>cnt;
for(i=0;i<n;i++)
{
cin>>x;
if(x%cnt==0) res++;
}
cout<<"so luong phan tu chia het cho "<<cnt<<" la: "<<res;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int gh=1000;
int n,x,i,cnt,res,dem[gh];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin>>n>>cnt;
for(i=0;i<n;i++)
{
cin>>x;
if(x%cnt==0) { res++; dem[res]=x;}
}
cout<<"so luong phan tu chia het cho "<<cnt<<" la: "<<res;
cout<<"\n"<<"cac phan tu do la: "<<"\n";
for(i=1;i<=res;i++)
cout<<dem[i]<<" ";
return 0;
}
// đây mới đúng mik đọc lỗi đề nha bạn!!
uses crt;
var st,s1,s2:string;
i,max,x,y,d1,d2:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
s1:=#32;
for i:=1 to length(st) do
if st[i] in ['a'..'z'] then s1:=s1+st[i];
d1:=length(s1);
for i:=1 to d1 do
s1[i]:=upcase(s1[i]);
writeln('Xau ky tu da chuyen sang hoa la: ',s1);
s2:=#32;
for i:=1 to length(st) do
if st[i] in ['0'..'9'] then s2:=s2+st[i];
write('Day so dao nguoc la: ');
d2:=length(s2);
for i:=d2 downto 1 do
write(s2[i]);
writeln;
max:=0;
for i:=1 to d2 do
begin
val(s2[i],x,y);
if max<x then max:=x;
end;
writeln('Chu so lon nhat la: ',max);
readln;
end.