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.
chán mí bạn ghê á!!!!
uses math;
var n,i:longint;
s:int64;
f:array[-10..1000000] of int64;
procedure dq(n:longint);
begin
if n<=1000000 then
begin
s:=s+f[n];
exit;
end
else
begin
dq(n div 2);
dq(n div 3);
dq(n div 4);
end;
end;
begin
assign(input,'dprc.inp');reset(input);
assign(output,'dprc.out');rewrite(output);
for i:=1 to 1000000 do
begin
f[i]:=max(i,f[i div 2]+f[i div 3]+f[i div 4]);
//write(f[i],' ');
end;
while not seekeof do
begin
readln(n);
s:=0;
dq(n);
writeln(s);
end;
end.
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.
uses crt;
const fi='abc.inp';
var a:array[1..100]of integer;
i,n,dem,j,kt,dem1,dem2:integer;
f1:text;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,n);
for i:=1 to n do
read(f1,a[i]);
dem:=0;
for i:=1 to n do
if a[i] mod 2=0 then inc(dem);
dem1:=0;
for i:=1 to n do
if a[i]>1 then
begin
kt:=0;
for j:=2 to a[i]-1 do
if a[i] mod j=0 then kt:=1;
if kt=0 then inc(dem1);
end;
dem2:=0;
for i:=1 to n do
if trunc(sqrt(a[i]))=sqrt(a[i]) then inc(dem2);
writeln('So so chan la: ',dem);
writeln('So so nguyen to la: ',dem1);
writeln('So so chinh phuong la: ',dem2);
close(f1);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i,k,x,a[1000];
int main()
{
cin>>n>>k;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
if (a[i]==k)
{
cout<<"YES";
return 0;
}
cout<<"NO";
return 0;
}
uses crt;
const fi='dlra.txt';
var a:array[1..100]of integer;
i,n,h:integer;
f1:text;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
assign(f1,fi); rewrite(f1);
h:=0;
for i:=1 to n do
if a[i] mod 3<>0 then
begin
write(f1,a[i]:4);
h:=h-a[i];
end;
writeln(f1);
writeln(f1,h);
close(f1);
readln;
end.
uses crt;
var st:string;
d,i:integer;
begin
clrscr;
readln(st);
d:=length(st);
for i:=1 to d do
if (st[i] in ['0'..'9']) then write(st[i]);
readln;
end.
Bạn vào việt jet hoặc nhấn link nha ;-;
https://hoc247.net/tin-hoc-11/bai-12-kieu-xau-l4211.html