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.
a)
uses crt;
var i,n:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until n<100;
if n mod 2=0 then
begin
for i:=0 to n do
if i mod 2=0 then write(i:4);
end
else writeln(n,' khong la so chan');
readln;
end.
b)
uses crt;
var i,n:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until n<100;
if n mod 2=1 then
begin
for i:=1 to n do
if i mod 2=1 then write(i:4);
end
else writeln(n,' khong la so le');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,A[100],dem,t;
cin>>n;
for (int i=1; i<=n; i++)
cin>>A[i];
dem=0; t=0;
for (int i=1; i<=n; i++)
if (A[i]%2==0) dem++;
else t+=A[i];
cout<<dem<<endl;
cout<<t;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
if (n%2==0) cout<<"Chan";
else cout<<"Le";
return 0;
}
uses crt;
var a,b,c,max:integer;
begin
clrscr;
write('nhap ba so:');readln(a,b,c);
if a mod 2=0 then writeln(a,' la so chan')
else writeln(a,'la so le);
if b mod 2=0 then writeln(b,'la so chan')
else writeln(b,'la so le');
if c mod 2=0 then writeln(c,'la so chan')
else writeln(c,'la so le');
max:=a;
if max<b then max:=b;
if max<c then max:=c;
writeln('so lon nhat trong ba so la:',max);
readln
end.
uses crt;
var n:longint;
begin
clrscr;
readln(n);
if n mod 2=0 then write('la so chan')
else write('la so le');
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n do
if a[i] mod 2=0 then write(a[i]:4);
readln;
end.
uses crt;
var a:array[1..1000000] of longint;
n,i:longint;
begin
clrscr;
write('Nhap so luong phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
end;
write('Cac so chan: ');
for i:=1 to n do if a[i] mod 2=0 then write(a[i],' ');
readln;
end.
program Chanle;
uses crt;
var x: integer;
begin
clrscr;
readln(x)
if (x mod 2 = 0) then write('day la so chan') else write('day la so le');
readln
end.