Những câu hỏi liên quan
Niễn Mạn Kỳ
Xem chi tiết
Nguyễn Lê Phước Thịnh
15 tháng 4 2021 lúc 20:20

uses crt;

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

n,i:integer;

begin

clrscr;

repeat

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

if n<=0 then writeln('Ban nhap sai, yeu cau nhap lai');

until n>0;

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.

Bình luận (0)
Bé Thúy
Xem chi tiết
Bùi Anh Tuấn
13 tháng 4 2021 lúc 20:13

program hoc24;

uses crt;

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

i,d,s: longint;

begin

clrscr;

for i:=1 to 6 do readln(a[i]);

s:=0;

for i:=1 to n do

if a[i]>0 then

begin

inc(d);

s:=s+a[i];

end;

writeln(d,s);

readln

end.

Bình luận (0)
Bùi Anh Tuấn
13 tháng 4 2021 lúc 20:14

bài chưa chạy thử bạn chạy lại xem nếu k đc thì bảo

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

uses crt;

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

i,dem,t:integer;

begin

clrscr;

for i:=1 to 6 do 

  begin

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

end;

dem:=0;

t:=0;

for i:=1 to 6 do 

if a[i]>0 then 

begin

inc(dem);

t:=t+a[i];

end;

writeln('So phan tu duong la: ',dem);

writeln('Tong cac phan tu duong la: ',t);

readln;

end.

Bình luận (0)
Nguyễn Thị Mỹ Tâm
Xem chi tiết
Nguyễn Lê Phước Thịnh
24 tháng 3 2021 lúc 20:23

uses crt;

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

i,n,dem,kt,t:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

dem:=0;

for i:=1 to n do 

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

t:=abs(a[2]-a[1]);

kt:=0;

for i:=1 to n do 

if t<>abs(a[i]-a[i-1]) then 

begin

kt:=1;

break;

end;

if kt=0 then writeln('Day la cap so cong')

else writeln('Day khong la cap so cong');

readln;

end.

Bình luận (0)
Đạt Nguyễn
Xem chi tiết
Trần Ái Linh
25 tháng 5 2021 lúc 9:52

program im_14424;

uses crt;

var A: array[1..100000] of integer;

S,i,n: integer;

begin

clrscr;

write('Nhap vao n: ');

readln(n);

S:=0;

for i:=1 to n do

begin

write('Nhap A[',i,']: ');

readln(A[i]);

if (A[i] mod 2 = 0 then S:=S+i;

end;

write(S);

readln

end.

Bình luận (2)
Ngân
Xem chi tiết
Hello1234
Xem chi tiết
Nguyễn Lê Phước Thịnh
26 tháng 10 2021 lúc 23:27

#include <bits/stdc++.h>

using namespace std;

string n;

int main()

{

cin>>st;

int d=st.length();

for (int i=0; i<=d-1; i++)

if (st[i]==0) st[i]='5'

cout<<st;

return 0;

}

Bình luận (0)
Hello1234
Xem chi tiết
Nguyễn Lê Phước Thịnh
26 tháng 10 2021 lúc 23:31

#include <bits/stdc++.h>

using namespace std;

string n;

int main()

{

cin>>st;

int d=st.length();

for (int i=0; i<=d-1; i++)

if (st[i]==0) st[i]='5'

cout<<st;

return 0;

}

Bình luận (0)
thanh thuý
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 5 2021 lúc 19:56

Câu 1:

uses crt;

var n,i,kt:integer;

begin

clrscr;

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

if n<2 then writeln(n,' khong la so nguyen to')

else begin

kt:=0;

for i:=2 to n-1 do 

  if n mod i=0 then kt:=1;

if kt=0 then writeln(n,' la so nguyen to')

else writeln(n,' khong la so nguyen to');

end;

readln;

end.

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

Câu 2: 

uses crt;

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

i,n,max,min:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

max:=a[1];

min:=a[1];

for i:=1 to n do 

  begin

if max<a[i] then max:=a[i];

if min>a[i] then min:=a[i];

end;

writeln('So lon nhat la: ',max);

writeln('So nho nhat la: ',min);

readln;

end.

Bình luận (0)
Giang Phạm
Xem chi tiết
Phạm Thế Mạnh
9 tháng 1 2016 lúc 16:04

\(n+26=a^3\left(a\in N\cdot\right)\)
\(n-11=b^3\left(b\in N\cdot\right)\)
=>\(a^3-b^3=37\)
\(\left(a-b\right)\left(a^2+ab+b^2\right)=37\)
\(\Rightarrow\left(a-b\right)\&\left(a^2+ab+b^2\right)\) là ước của 37
Mà \(a^2-ab+b^2\ge a-b\ge0\)
\(\int^{a^2+ab+b^2=37}_{a-b=1}\Leftrightarrow\int^{a=b+1}_{\left(b+1\right)^2+b\left(b+1\right)+b^2=37}\Leftrightarrow\int^{a=b+1}_{3b^2+3b-36=0}\Leftrightarrow\int^{a=4}_{b=3}\)(vì a;b>0) thay hoặc a vào chỗ đặt rồi tự tìm nốt

Bình luận (0)