"dòng chữ tinh ranh" dc cấu tạo như sau:1 dòng số là luỹ thừa 4 của các số nguyên tố từ nhỏ đến lớn và ko có dấu cách giữa các số. VD:16816252401....
viết chương trình xác định chữ số ở vị trí k(với k>=50000) của dòng chữ tinh ranh
..."> ..."> ..." />
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.
program dongchutinhranh;
uses crt;
var k,i,j,t,m,n:longint;
s:string;
begin
clrscr;
write('k=');readln(k);
i:=1;
while j<k do
begin
i:=i+1;
for t:=1 to trunc(sqrt(i)) do {trunc(i):lay phan nguyen cua i}
if i mod t=0 then m:=t;
if m=1 then
begin
n:=i*i*i*i;
str(n,s);
j:=j+length(s);
end;
end;
j:=length(s)-(j-k);
writeln(S[j]);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n,i,x,t,dem,j;
int main()
{
cin>>n;
x=n;
t=0;
while (n>0)
{
t=t+n%10;
n=n/10;
}
cout<<t;
dem=0;
for (i=2; i<=x; i++)
{
bool kt=true;
for (j=2; j*j<=i; j++)
if (i%j==0) kt=false;
if (kt==true) dem++;
}
cout<<dem;
return 0;
}
uses crt;
var a:array[1..100]of integer;
i,n,t,t1,t2,t3,min,max:integer;
kt:boolean;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
writeln('Day so ban vua nhap la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
t:=0;
for i:=1 to n do
t:=t+a[i];
kt:=true;
for i:=2 to trunc(sqrt(t)) do
if t mod i=0 then
begin
kt:=false;
break;
end;
writeln('Tong cua day so la: ',t);
if (kt=true) and (t>1) then writeln(t,' la so nguyen to')
else writeln(t,' khong la so nguyen to');
writeln('Cac so o vi tri le cua day so la: ');
t1:=0;
for i:=1 to n do
if i mod 2=1 then
begin
write(a[i]:4);
t1:=t1+a[i];
end;
writeln;
writeln('Tong cac so o vi tri le cua day so la: ',t1);
if trunc(sqrt(t1))=sqrt(t1) then writeln(t1,' la so chinh phuong')
else writeln(t1,' khong la so chinh phuong');
writeln('Cac so o vi tri chan cua day so la: ');
t2:=0;
for i:=1 to n do
if i mod 2=0 then
begin
write(a[i]:4);
t2:=t2+a[i];
end;
writeln;
writeln('Tong cac so o vi tri chan cua day so la: ',t2);
t3:=0;
for i:=1 to t2 do
if t2 mod i=0 then t3:=t3+i;
if t3=t2 then writeln(t2,' la so hoan hao')
else writeln(t2,' khong la so hoan hao');
max:=a[1];
min:=a[1];
for i:=1 to n do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writeln('So lon nhat cua day la: ',max);
writeln('So nho nhat cua day la: ',min);
writeln('Tong cua so lon nhat va so nho nhat la: ',max+min);
readln;
end.
uses crt;
var a:array[1..100]of integer;
n,i,t,kt,j,t1,t2,t3,max,min:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
writeln('Day so ban vua nhap la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln('Tong cua day so vua nhap la: ',t);
kt:=0;
for i:=2 to trunc(sqrt(t)) do
if t mod i=0 then
begin
kt:=1;
break;
end;
if (kt=0) and (t>1) then writeln(t,' la so nguyen to');
else writeln(t,' khong la so nguyen to');
t1:=0;
writeln('Cac so o vi tri le cua day la: ');
for i:=1 to n do
if i mod 2=1 then
begin
write(a[i]:4);
t1:=t1+a[i];
end;
writeln;
writeln('Tong cac so o vi tri le la: ',t1);
if trunc(sqrt(t1))=sqrt(t1) then writeln(t1,' la so chinh phuong')
else writeln(t1,' khong la so chinh phuong');
t2:=0;
writeln('Cac so o vi tri chan la: ');
for i:=1 to n do
if i mod 2=0 then
begin
write(a[i]:4);
t2:=t2+a[i];
end;
writeln;
writeln('Tong cac so o vi tri chan la: ',t2);
t3:=0;
for i:=1 to t2 do
if t2 mod i=0 then t3:=t3+i;
if t3=t2 then writeln(t2,' la so hoan hao')
else writeln(t2,' khong la so hoan hao');
max:=a[1];
min:=a[1];
for i:=1 to n do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writeln('Gia tri lon nhat la: ',max);
writeln('Gia tri nho nhat la: ',min);
writeln('Tong cua hai so lon nhat va nho nhat la: ',max+min);
readln;
end.
A=input("Nhập dãy các số cách nhau bởi dấu cách: ")
S=A.split()
k = 0
n=[]
c = len(S)
m1 = min(S)
m2 = max(S)
for x in S:
n.append(float(x))
b=[]
for a in n :
if a % 2 != 0 :
b.append(float(a))
S=0
for i in b:
k=k+i
print("Số lượng các số đã nhập",c)
print("Tổng các số lẻ là", k)
print("Số nhỏ nhất là", m1)
print("Số lớn nhất là ", m2)
010010110101011010101001001001011010111101000111001010101101010010101011011101001011010101000100101001011010101101010100100100101101011110100011100101010110101001010101101110100101101010100010010100101101010110101010010010010110101111010001110010101011010100101010110111010010110101010001001010010110101011010101001001001011010111101000111001010101101010010101011011101001011010101000100101001011010101101010100100100101101011110100011100101010110101001010101101110100101101010100010010100101101010110101010010010010110101111010001110010101011010100101010110111010010110101010001001010010110101011010101001001001011010111101000111001010101101010010101011011101001011010101000100101001011010101101010100100100101101011110100011100101010110101001010101101110100101101010100010010100101101010110101010010010010110101111010001110010101011010100101010110111010010110101010001001010010110101011010101001001001011010111101000111001010101101010010101011011101001011010101000100101001011010101101010100100100101101011110100011100101010110101001010101101110100101101010100010010100101101010110101010010010010110101111010001110010101011010100101010110111010010110101010001001010010110101011010101001001001011010111101000111001010101101010010101011011101001011010101000100101001011010101101010100100100101101011110100011100101010110101001010101101110100101101010100010010100101101010110101010010010010110101111010001110010101011010100101010110111010010110101010001001010010110101011010101001001001011010111101000111001010101101010010101011011101001011010101000100101001011010101101010100100100101101011110100011100101010110101001010101101110100101101010100010010100101101010110101010010010010110101111010001110010101011010100101010110111010010110101010001001
pascal bạn oi