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.
Đề không cho kiểu dữ liệu gì nên mình vt longint
var A,B,C,D:longint;
begin
write('nhap A='); readln(A);
write('nhap B='); readln(B);
write('nhap C='); readln(C);
write('nhap D='); readln(D);
if A mod 2 = 0 then writeln(A,' la so chan') else writeln(A, ' la so le');
if B mod 3 = 0 then writeln(B,' chia het cho 3') else writeln(B,' ko chia het cho 3');
if C mod 5 = 0 then writeln(C,' chia het cho 5') else writeln(C,' ko chia het cho 5');
if D mod 9 = 0 then writeln(D,'chia het cho 9') else write(D,' ko chia het cho 9');
end.
uses crt;
var a,b:longint;
Begin
clrscr;
Writeln('Nhap a,b=');
Readln(a,b);
writeln('tich hai so la : a*b=',a*b);
writeln('thuong hai so la :a/b=',a/b);
Readln;
End.
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.
Var n,sc,sl,i:longint;
Begin
Write('N = ');readln(n);
Write('Cac so tu 1 den ',n,' la ');
For i:=1 to n do
Write(i:8);
Writeln;
For i:=1 to n do
Begin
If i mod 2 = 0 then sc:=sc+i
Else sl:=sl+i;
End;
Writeln('Tong cac so chan la ',sc);
Write('Tong cac so le la ',sl);
Readln
End.
1:
#include <bits/stdc++.h>
using namespace std;
long long a[100],i,n;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
cout<<"Day ban dau la: "<<endl;
for (i=1;i<=n; i++) cout<<a[i]<<" ";
cout<<endl;
sort(a+1,a+n+1);
cout<<"Day tang dan la: "<<endl;
for (i=1; i<=n; i++) cout<<a[i]<<" ";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
string n;
int d;
int main()
{
cin>>n;
d=n.length();
cout<<d;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long i,a,b;
int main()
{
cin>>a>>b;
for (i=1; i<=min(a,b); i++)
if ((a%i==0) and (b%i==0)) cout<<i<<" ";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a,b,bcnn;
int main()
{
cin>>a>>b;
if (a>b) swap(a,b);
bcnn=b;
while (bcnn%a!=0)
bcnn=bcnn+b;
cout<<bcnn;
return 0;
}
uses crt;
var a:array[1..15]of integer;
n:integer;
begin
clrscr;
n:=1;
a[1]:=3;
repeat
n:=n+2;
a[n]:=a[n-1]+3;
until a[n]>40;
for i:=1 to n-1 do
write(a[i]:4);
readln;
end.