K
Khách

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.

10 tháng 5 2023

Câu 58:

Var n:integer;

Begin

Write('n = ');readln(n);

If n mod 2 <> 0 then write(n,' la so le')

Else write(n,' khong la so le');

Readln

End.

10 tháng 5 2023

Câu 61:

Var n:integer;

Begin

Write('n = ');readln(n);

If n mod 2 = 0 then write(n,' la so chan')

Else write(n,' khong la so chan');

Readln

End.

14 tháng 11 2021

#include <bits/stdc++.h>

using namespace std;

long long n;

int main()

{

cin>>n;

if (n%2==0) cout<<"La so chan";

else cout<<"La so le";

return 0;

}

20 tháng 3 2023

program BangCuuChuong;
var
  N, i, j: integer;
  IsEven: boolean;
  IsPrime: boolean;
begin
  write('Nhap N (0 < N < 10): ');
  readln(N);

  // Kiểm tra N có phải số chẵn hay lẻ
  IsEven := (N mod 2 = 0);
  if IsEven then
    writeln(N, ' la so chan')
  else
    writeln(N, ' la so le');

  // Kiểm tra N có phải số nguyên tố hay không
  IsPrime := true;
  if (N < 2) then
    IsPrime := false
  else
    for i := 2 to trunc(sqrt(N)) do
      if (N mod i = 0) then
      begin
        IsPrime := false;
        break;
      end;
  if IsPrime then
    writeln(N, ' la so nguyen to')
  else
    writeln(N, ' khong la so nguyen to');

  // In ra bảng cửu chương N
  writeln('Bang cuu chuong ', N, ':');
  for i := 1 to 10 do
  begin
    j := i * N;
    writeln(N, ' x ', i, ' = ', j);
  end;

  readln;
end.

Mấy cái phần mình gạch // là giải thích phần code đó làm gì nha.

20 tháng 3 2023

Program HOC24;

var i,n,d: byte;

begin

write('Nhap N: '); readln(n);

writeln('Bang cuu chuong ',n,' : '); 

for i:=1 to 10 do writeln(n,' x ',i,' = ',n*i);

if n mod 2=0 then writeln(n,'  la so chan ') else writeln(n,' la so le');

d:=0;

for i:=1 to n do if n mod i=0 then d:=d+1;

if d=2 then write(n,' la so nguyen to') else write(n,' khong phai la so nguyen to');

readln

end.

16 tháng 2 2023

Đáp án B.

Nhưng là Do nhé, không phải So

1 tháng 1 2021

var n,i,k,d: integer;

a:array[1..52] of integer;

begin

write('Nhap so N: '); readln(n);

for i:=1 to n do

begin

write('a[',i,'] = '); readln(a[i]);

end;

write('Nhap so k: '); readln(k);

d:=0;

for i:=1 to n do

if a[i] mod k = 0 then d:=d+1;

writeln('Co ',d,' so chia het cho ',k,' trong day');

if d mod 2 = 0 then writeln('Chan') else writeln('Le');

end.

uses crt;

var a:array[1..52]of integer;

i,n,k,dem:integer;

begin

clrscr;

repeat

write('Nhap n='); readln(n);

until (0<n) and (n<=52);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

write('Nhap k='); readln(k);

dem:=0;

for i:=1 to n do  

  if a[i] mod k=0 then inc(dem);

writeln('Trong day co ',dem,' so chia het cho ',k);

if dem mod 2=0 then writeln('So luong so chia het cho ',k,' la so chan')

else writeln('So luong so chia het cho ',k,' la so le');

readln;

end.

19 tháng 10 2021

Hỏi đáp Tin học

19 tháng 10 2021

Input: số nguyên N

Output: N là chẵn hoặc N là lẻ

- Thuật toán liệt kê:

+ Bước 1: Nhập N

+ Bước 2: Nếu N chia hết cho 2 thì in ra N chẵn và kết thúc thuật toán ngược lại nếu N không chia hết cho 2 thì in ra N lẻ và kết thúc thuật toán

- Thuật toán sơ đồ khối:

 

Hỏi đáp Tin học

 

 

 

 

11 tháng 11 2021

uses crt;

var a:int64;

begin

clrscr;

readln(a);

if a mod 2=0 then writeln('la so chan')

else writeln('la so le');

readln;

end.