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 a,b:int64;
begin
clrscr;
readln(a,b);
writeln(a*a+b*b);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln(t);
readln;
end.
Var r,s,c:real;
Begin
Write('Ban kinh = ');readln(r);
s:=3.14*r*r;
c:=2*3.14*r;
Writeln('Dien tich la ',s:10:2);
Write('Chu vi la ',c:10:2);
Readln
End.
uses crt;
var a,b,x,y:integer;
//chuongtrinhcon
function ucln(var a,b:integer):integer;
var r:integer;
begin
while b>0 do
begin
r:=a mod b;
a:=b;
b:=r;
end;
ucln:=a;
end;
//chuongtrinhchinh
begin
clrscr;
readln(a,b);
x:=a;
y:=b;
if (x>0) and (y>0) then writeln(x div ucln(a,b),' ',y div ucln(a,b));
if (x<0) and (y<0) then
begin
x:=abs(x);
y:=abs(y);
a:=abs(a);
b:=abs(b);
writeln(x div ucln(a,b),' ',y div ucln(a,b));
end;
if (x<0) and (y>0) then
begin
write('-');
x:=abs(x);
y:=abs(y);
a:=abs(a);
b:=abs(b);
writeln(x div ucln(a,b),' ',y div ucln(a,b));
end;
if (x>0) and (y<0) then
begin
write('-');
x:=abs(x);
y:=abs(y);
a:=abs(a);
b:=abs(b);
writeln(x div ucln(a,b),' ',y div ucln(a,b));
end;
readln;
end.
uses crt;
var a,b:int64;
begin
clrscr;
readln(a,b);
writeln(a+b);
readln;
end.
1.
Var i ,n : integer;
S , T : real;
Begin
Write ('n:') ;
Read (n) ;
S:= 0;
T:= 1;
For i:= 1 to n do
S:= S + i;
T:= T * i;
Writeln (' Tong cua ' ,n,' , S );
Writeln (' Tich của ' ,n,', T );
Readln;
End.
2.
program SumAndProductOfNumbers;
var
n, m, i, sum, product: integer;
begin
writeln('Enter the values of n and m: ');
readln(n, m);
sum := 0;
product := 1;
for i := n to m do
begin
sum := sum + i;
product := product * i;
end;
writeln('The sum of numbers from ', n, ' to ', m, ' is: ', sum);
writeln('The product of numbers from ', n, ' to ', m, ' is: ', product);
end.
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<(a+b)*2<<endl;
cout<<a*b;
return 0;
}
uses crt;
var x,n,i,t:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=1 to n do
begin
readln(x);
if x mod 2=0 then t:=t+x;
end;
writeln(t);
readln;
end.
program ideone;
var i,n,x,res:longint;
begin
readln(n);
res:=0;
for i:=1 to n do
begin
read(x);
if x mod 2 = 0 then
res:=res+x;
end;
write(res);
end.