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.
1/
program uoc;
uses crt;
var n,i,dem,x:word;
a:array[1..20] of longint;
begin
clrscr;
write('nhap so phan tu cua day:') ;readln(n);
while n>20 do
begin
write('nhap lai so phan tu thoa man toi da la 20 phan tu:');
readln(n);
end;
writeln('nhap cac phan tu cua mang:');
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
write('nhap so nguyen x:'); readln(x);
dem:=0;
for i:=1 to n do
if x mod a[i] =0 then
begin
dem:=dem+1;
writeln(a[i],' la uoc cua ',x);
end;
if dem=0 then writeln('khong co phan tu la uoc cua ',x)
else write('co ',dem,' phan tu la uoc cua ',x);
readln;
end.
1:
uses crt;
var a:array[1..100]of integer;
i,n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n do
write(a[i]:4);
readln;
end.
2:
uses crt;
var a:array[1..100]of integer;
i,n,j,tam:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
for i:=1 to n do
write(a[i]:4);
readln;
end.
3:
uses crt;
var x,i,max:integer;
begin
clrscr;
repeat
write('Nhap x='); readln(x);
until x>0;
max:=0;
for i:=1 to x do
if i mod 2=0 then
begin
if max<=i then max:=i;
end;
writeln('So chan lon nhat khong vuot qua ',x,' la: ',max);
readln;
end.
uses crt;
var a,b,c,d,tb:real;
begin
clrscr;
write('Nhap diem cua ban:'); readln(a,b,c,d);
tb:=(a+b+c+d)/7;
if tb>=8 then writeln('Gioi');
if (6,5<=tb) and (tb<8) then writeln('Kha');
if (5<=tb) and (tb<6,5) then writeln('Trung Binh');
if tb<5 then writeln('Yeu');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long x,n,i,t,dem;
int main()
{
cin>>n;
dem=0;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x%2==0 && x>10) t+=x;
if (x%2!=0 || x<100) dem++;
}
cout<<t<<" "<<dem;
return 0;
}
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;
}
k thấy rõ bạn ơi