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 n,i:longint;
t:real;
begin
clrscr;
write('n='); readln(n);
if (1<=n) and (n<=10000) then
begin
t:=0;
for i:=1 to n do
t:=t+(1/(sqr(i)));
writeln('T=',t:4:2);
end
else writeln('vui long nhap lai n');
readln;
end.
1.
var n: integer;
begin
repeat
write('Nhap so n: '); readln(n);
until (n>=10) and (99>=n);
writeln('Chu so hang chuc la: ', n div 10);
writeln('Chu so hang don vi la: ', n mod 10);
end.
2.
var n,i: integer;
s: string;
begin
repeat
write('Nhap so n: '); readln(n);
until (n>=100) and (999>=n);
write('So moi la: ');
str(n,s);
for i:=length(s) downto 1 do write(s[i]);
end.
Program hotrotinhoc;
var s: longint;
i,n: integer;
function lt(x,y: integer): longint;
var l,t: longint;
begin
t:=1;
for l:=1 to y do t:=t*x;
lt:=t;
end;
begin
write('N='); readln(n);
for i:=2 to n do
if (i-1) mod 2<>0 then s:=s+lt((i-1),i)
else
if (i-1) mod 2=0 then s:=s-lt((i-1),i);
write(s);
readln
end.
#include <bits/stdc++.h>
using namespace std;
string n;
int d;
int main()
{
cin>>n;
d=n.length();
cout<<d;
return 0;
}
uses crt;
var a:array[1..100]of integer;
i,n,t1,t2,t3:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
t1:=0;
t2:=0;
t3:=0;
for i:=1 to n do
begin
if a[i] mod 2=0 then t1:=t1+a[i]
else t2:=t2+a[i];
if (a[i] mod 2=0) and (a[i] mod 3=0) then t3:=t3+a[i];
end;
writeln(t1);
writeln(t2);
writeln(t3);
readln;
end.
uses crt;
type mang=array[1..100]of integer;
var a:mang;
{-------------------cau-1---------------------------}
function nhap(var b:mang):integer;
var i,n:integer;
begin
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(b[i]);
end;
end;
{-------------------cau-2---------------------------}
function xuat(var b:mang):integer;
var i,n:integer;
begin
writeln('Day so ban vua nhap la: ');
for i:=1 to n do
write(b[i]:4);
end;
{-------------------cau-3---------------------------}
function sapxep(var b:mang):integer;
var i,n,tam,j:integer;
begin
for i:=1 to n-1 do
for j:=i+1 to n do
if b[i]<b[j] then
begin
tam:=b[i];
b[i]:=b[j];
b[j]:=tam;
end;
writeln;
writeln('Day so giam dan la: ');
for i:=1 to n do write(b[i]:4);
end;
{-----------------chuong-trinh-chinh------------------------}
begin
clrscr;
nhap(a);
xuat(a);
sapxep(a);
readln;
end.
uses crt;
var n,i:longint;
kt:boolean;
begin
clrscr;
readln(n);
if (n<2) then writeln('Nhap lai')
else
begin
kt:=true;
for i:=2 to trunc(sqrt(n)) do
if n mod i=0 then
begin
kt:=false;
break;
end;
if kt=true then writeln('la so nguyen to')
else writeln('khong la so nguyen to');
end;
readln;
end.
uses crt;
var n,i:integer;
s:real;
begin
clrscr;
write('n='); readln(n);
if (n>=0) and (n<=100) then
begin
s:=0;
for i:=1 to n do
s:=s+(i/(i+1));
writeln('tong la: ',s);
end
else writeln('vui long nhap lai');
readln;
end.
cảm ơn nha