Những câu hỏi liên quan
Gia Hưng Lớp 7/2
Xem chi tiết
datcoder
3 tháng 11 2023 lúc 0:38

#include <bits/stdc++.h>

using namespace std;

int main () { int a[1000],n,i;

cin >> n;

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

cin >> a[i];

for (int i=2;i<=n;i++)

if (((a[i]<0) and (a[i-1]<0)) or ((a[i]>0) and (a[i-1]>0))) {

cout << a[i-1] <<" " << a[i];

break; }

return 0;

}

Dandelion
Xem chi tiết
★゚°☆ Trung_Phan☆° ゚★
25 tháng 2 2021 lúc 21:41

undefined

Theo C++ nhé bạn

Codeblacks 

Nguyễn Lê Phước Thịnh
25 tháng 2 2021 lúc 21:51

uses crt;

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

i,n,dem:integer;

begin

clrscr;

for i:=1 to 10 do 

  begin

repeat

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

until a[i]>0;

end;

writeln('Day so vua nhap la: ');

for i:=1 to 10 do 

  write(a[i]:4);

dem:=0;

for i:=1 to n do 

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

writeln;

writeln('So luong so chan la: ',dem);

readln;

end.

lê anh khôi
Xem chi tiết
lê anh khôi
6 tháng 3 2021 lúc 15:00

ai làm giúp mình

 

Nguyễn Minh Doanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
16 tháng 3 2021 lúc 21:36

uses crt;

var n,i,d,max,x,y:integer;

st:string;

begin

clrscr;

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

str(n,st);

d:=length(st);

max:=0;

for i:=1 to d do 

  begin

val(st[i],x,y);

if max<x then max:=x;

end;

writeln(max);

readln;

end.

Bpxi
Xem chi tiết
Nguyễn khánh thành
Xem chi tiết
NGUYỄN LÊ XUÂN THỊNH
Xem chi tiết
Kiều Vũ Linh
23 tháng 2 2023 lúc 11:23

Bài 1

Var s,i:integer;

tb:real;

Begin

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

i:=1;

s:=0;

While i<=n do

Begin

s:=s+i;

i:=i+1;

End;

tb:=s/n;

Writeln('Tong la ',s);

Write('Trung binh la ',tb:10:2);

Readln;

End.

Kiều Vũ Linh
23 tháng 2 2023 lúc 11:27

Bài 2

Var i,n,souoc:integer;

Begin

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

i:=1;

While i <= n do

Begin

i:=i + 1;

If n mod i = 0 then souoc:=souoc + 1;

End;

If souoc = 1 then write(n,' la so nguyen to')

Else write(n,' khong la so nguyen to');

Readln;

End.

Võ Ngọc Huy
Xem chi tiết
Phan Thu
Xem chi tiết