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.

3 tháng 8 2020

bạn không nên đưa những câu hỏi linh tinh,vớ  vẩn lên diễn đàn nha

27 tháng 3 2022

Lưu ý :Dùng C++

uses crt;

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

i,n,t,j,tam:integer;

begin

clrscr;

readln(n);

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

for i:=1 to n do write(a[i]:5);

writeln;

writeln('Cac so duong la: ');

for i:=1 to n do if (a[i]>0) then write(a[i]:4);

writeln;

t:=0;

for i:=1 to n do 

  if a[i] mod 3=0 then t:=t+a[i];

writeln(t);

for i:=1 to n-1 do 

  for j:=i+1 to n do

if a[i]<a[j] then

begin

tam:=a[i];

a[i]:=a[j];

a[j]:=tam;

end;

for i:=1 to n  do write(a[i]:4);

readln;

end.

#include <bits/stdc++.h>

using namespace std;

string st;

int d,i;

int main()

{

getline(cin,st);

d=st.length();

for (i=0; i<=d-1; i++) swap(st[i],st[n-1-(i-1)]);

cout<<st;

return 0;

}

 

#include <bits/stdc++.h>

using namespace std;

long long b[15],i,n,k,dem;

bool kt;

int main()

{

n=15;

for (i=1; i<=n; i++) cin>>b[i];

for (i=1; i<=n; i++) cout<<b[i]<<" ";

cout<<endl;

dem=0;

for (i=1; i<=n; i++) if (b[i]%2==0) dem++;

cout<<"So so chan la: "<<dem<<endl;

cin>>k;

kt=false;

for (i=1; i<=n; i++) if (b[i]==k) 

{

cout<<i<<" ";

kt=true;

}

if (kt==false) cout<<"Khong co k trong day";

else cout<<endl;

sort(b+1,b+n+1);

for (i=1; i<=n; i++) cout<<b[i]<<" ";

return 0;

}

3:

#include <bits/stdc++.h>

using namespace std;

int A[100],i,n,x,kt;

int main()

{

cin>>n;

for (int i=1; i<=n; i++) cin>>A[i];

cin>>x;

kt=0;

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

if (A[i]==x) then kt=1;

if (kt==0) cout<<"NO";

else 

{

for (int i=n; i>=1; i--)

if (A[i]==x) 

{

cout<<A[i];

return 0;

}

}

return 0;

}

4:

#include <bits/stdc++.h>

using namespace std;

int A[100],i,n;

int main()

{

cin>>n;

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

cin>>A[i];

sort(A+1,A+n+1);

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

cout<<A[i]<<" ";

return 0;

}

4 tháng 2 2022

chinh phục

26 tháng 2 2017

Bài thơ Vịnh khoa thi Hương:

“Nhà nước ba năm mở một khoa

 Trường Nam thi lẫn với trường Hà

 Lôi thôi sĩ tử vai đeo lọ

Ậm ọe quan trường miệng thét loe

Lọng cắm rợp trời quan sứ đến

Váy lê quét đất mụ đầm ra

Nhân tài đất Bắc nào ai đó

Ngoảnh cổ mà trông cảnh nước nhà”

1:

uses crt;

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

i,n:integer;

begin

clrscr;

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

for i:=1 to n do

  begin

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

end;

for i:=1 to n do 

  write(a[i]:4);

readln;

end.

2: 

uses crt;

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

i,n,j,tam:integer;

begin

clrscr;

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

for i:=1 to n do

  begin

write('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

begin

tam:=a[i];

a[i]:=a[j];

a[j]:=tam;

end;

for i:=1 to n do 

  write(a[i]:4);

readln;

end.

3:

uses crt;

var x,i,max:integer;

begin

clrscr;

repeat

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

until x>0;

max:=0;

for i:=1 to x do 

  if i mod 2=0 then

begin

if max<=i then max:=i;

end;

writeln('So chan lon nhat khong vuot qua ',x,' la: ',max);

readln;

end.