Những câu hỏi liên quan
linh
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 12 2021 lúc 22:08

#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;

}

Bình luận (0)
Trần nguyên sang
Xem chi tiết
Hinn
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 12 2021 lúc 23:59

#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;

}

Bình luận (0)
lam nguyen
Xem chi tiết
Nguyễn Lê Phước Thịnh
3 tháng 12 2021 lúc 22:14

#include <bits/stdc++.h>

using namespace std;

long long n;

int main()

{

cin>>n;

if (n<0) cout<<"la so am";

else cout<<"la so duong";

return 0;

}

Bình luận (0)
ngomanhcuong
Xem chi tiết
Nguyễn Lê Phước Thịnh
15 tháng 3 2022 lúc 20:25

#include <bits/stdc++.h>

using namespace std;

long long x,n,i,t,dem;

int main()

{

cin>>n;

dem=0;

t=0;

for (i=1; i<=n; i++)

{

cin>>x;

if (x%2==0 && x>10) t+=x;

if (x%2!=0 || x<100) dem++;

}

cout<<t<<" "<<dem;

return 0;

}

Bình luận (0)
Trúc Anh
Xem chi tiết
Đình Hải
27 tháng 12 2022 lúc 0:23

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.

 

 

Bình luận (0)
Ái Cầm Trần
Xem chi tiết
Ngáo Ngơ Alice
Xem chi tiết
nguyễn an phát
11 tháng 4 2021 lúc 12:02

program timtich;

uses  crt;

var i,n:integer;

tich:longint;

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

begin

clrscr;

write('nhap so n:');readln(n);

for i:=1 to n do

begin

write('nhap phan tu a[',i,']:');readln(a[i]);

end;

for i:=1 to n do

write(a[i]:4);

tich:=1;

writeln;

for i:=1 to n do

if a[i] mod 2=0 then tich:=tich*a[i];

writeln('tich ca phan tu chan cua mang la:',tich);

readln;

end.

program timtong;

uses  crt;

var i,n:integer;

tong:longint;

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

begin

clrscr;

write('nhap so n:');readln(n);

for i:=1 to n do

begin

write('nhap phan tu a[',i,']:');readln(a[i]);

end;

for i:=1 to n do

write(a[i]:4);

tong:=0;

writeln;

for i:=1 to n do

if a[i] mod 2=0 then tong:=tong+a[i];

writeln('tong cac phan tu chan cua mang la:',tong);

tong:=0;

writeln;

for i:=1 to n do

if a[i] mod 2=1 then tong:=tong+a[i];

writeln('tong cac phan tu le cua mang la:',tong);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
11 tháng 4 2021 lúc 17:56

Bài 1: 

uses crt;

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

i,n,s:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

s:=1;

for i:=1 to n do 

  if a[i] mod 2=0 then s:=s*a[i];

writeln(s);

readln;

end.

Bình luận (0)
Nguyễn Lê Phước Thịnh
11 tháng 4 2021 lúc 17:57

uses crt;

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

i,n,t1,t2:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

t1:=0;

t2:=0;

for i:=1 to n do

begin

if a[i] mod 2=0 then t1:=t1+a[i]

else t2:=t2+a[i];

end;

writeln('Tong cac so chan la: ',t1);

writeln('Tong cac so le la: ',t2);

readln;

end.

Bình luận (0)
Thái Bảo
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 12 2020 lúc 20:08

uses crt;

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

i,n,tc,tl,t:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

tc:=0;

tl:=0;

for i:=1 to n do 

  begin

if a[i] mod 2=0 then tc:=tc+a[i]

else tl:=tl+a[i];

end;

writeln('Tong cac so chan la: ',tc);

writeln('Tong cac so le la: ',tl);

t:=0;

for i:=1 to n do  

t:=t+a[i];

writeln('Tong cua day so la: ',t);

readln;

end. 

Bình luận (1)