Những câu hỏi liên quan
Ái Cầm Trần
Xem chi tiết
Lucky Kate
Xem chi tiết
Bao112233
17 tháng 12 2022 lúc 21:22

b) 

#include <iostream>
using namespace std;
int a;
int main(){
    cin>>a;
    if (a%2==0) cout<<a<<" la so chan";
    else cout<<a<< "la so le";
    return 0;
}

Bình luận (0)
Trang Hoàng
Xem chi tiết
Nguyễn Lê Phước Thịnh
16 tháng 12 2022 lúc 14:37

#include <bits/stdc++.h>

using namespace std;

double a,b;

int main()

{

cin>>a>>b;

if (a>b) cout<<"a lon hon b";

else if (a<b) cout<<"a nho hon b";

else cout<<"a=b";

return 0;

}

Bình luận (0)
Nguyenthanh
Xem chi tiết
Nguyễn Lê Phước Thịnh
8 tháng 5 2021 lúc 20:07

a) 

uses crt;

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

i,n,max: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];

for i:=1 to n do 

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

writeln(max);

readln;

end.

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

b) 

uses crt;

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

i,n,min:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

min:=a[1];

for i:=1 to n do 

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

writeln(min);

readln;

end.

Bình luận (0)
Phước Thiện Lê Hoàng
Xem chi tiết
Nguyễn Lê Phước Thịnh
22 tháng 4 2021 lúc 21:27

1:

uses crt;

const fi='ketqua.txt'

var f1:text;

st:string;

i,d:integer;

begin

clrscr;

assign(f1,fi); rewrite(f1);

write('Nhap xau:'); readln(st);

d:=length(st);

for i:=1 to d do 

 if st[i]=#32 then delete(st,i,1);

writeln(f1,st);

close(f1);

end.

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

2:

uses crt;

var a,b,c,d:integer;

{----------chuong-trinh-con-----------------------}

function min(x,y:integer):integer;

begin

if x<y then min:=x

else min:=y;

end;

{---------------chuong-trinh-chinh--------------------}

begin

clrscr;

write('a='); readln(a);

write('b='); readln(b);

write('c='); readln(c);

write('d='); readln(d);

writeln(min(a,min(b,min(c,d))));

readln;

end.

Bình luận (1)
Phạm Thị Đông Nhi_HDI
Xem chi tiết
shitbo
21 tháng 6 2020 lúc 16:54

program hello;

uses crt;

Var n,i,j,k: integer;

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

begin;

a[1]:=k;

Readln(n);

For i:=1 to n do

Begin;

Writeln('nhap a[',i,'] '); Readln(a[i]);

End;

For i:=1 to n-1 do

For j:=i+1 to n do

If a[i]<a[j] then k:=a[j];

Writeln('gia tri lon nhat la', k);

end.

Bình luận (0)
 Khách vãng lai đã xóa
hoàng kim
Xem chi tiết
Nguyễn Lê Phước Thịnh
5 tháng 5 2021 lúc 23:25

Bài 1: 

uses crt;

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

i,n,min:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

min:=a[1];

for i:=1 to n do 

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

writeln(min);

readln;

end.

Bình luận (1)
Nguyễn Lê Phước Thịnh
5 tháng 5 2021 lúc 23:26

Bài 2: 

uses crt;

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

i,n,max:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

max:=a[1];

for i:=1 to n do 

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

writeln(max);

readln;

end.

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)
Hirabbitx
Xem chi tiết
Nguyễn Lê Phước Thịnh
7 tháng 1 2022 lúc 10:17

Chọn D

Bình luận (0)
tranlong
8 tháng 1 2022 lúc 0:21

Khai báo biến a và b thuộc kiểu Integer

Bình luận (0)