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.

7 tháng 5 2021

Khi nãy gửi nhầm 2 cái nha 

program Baitap1;

uses crt;

var Min ,n, i:integer;

      A: array [1..1000] of 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];

write('So Nho Nhat Trong Mang La ',Min);

readln;

end.       

#include <bits/stdc++.h>

using namespace std;

long long a[200],i,n,k;

int main()

{

cin>>n;

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

cin>>k;

kt=false;

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

if (a[i]==k)

{

cout<<i<<" ";

kt=true;

}

cout<<endl;

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

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

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

return 0;

}

#include <bits/stdc++.h>
using namespace std;
const long long maxint=1e6;
long long a[maxint],i,n,ln;
int main()
{
    cin>>n;
    for (i=1; i<=n; i++)
        cin>>a[i];
    ln=a[1];
    for (i=1; i<=n; i++)
        ln=max(ln,a[i]);
    for (i=n; i>=1; i--)
        if (ln==a[i])
    {
        cout<<i;
        break;
    }
    return 0;
}

 

uses crt;

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

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

t:=0;

for i:=1 to n do 

  if max=a[i] then t:=t+a[i];

writeln('Tong cac phan tu co gia tri lon nhat la: ',t);

readln;

end.

31 tháng 1 2021

Thầy em cho em viết đề như v em cũng k biết nửa 🥺

10 tháng 12 2020

10 tháng 12 2020

uses crt;

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

i,n,min:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

write('B[',i,']='); readln(b[i]);

end;

min:=b[1];

for i:=1 to n do 

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

writeln('So nho nhat la: ',b[i]);

readln;

end.

#include <bits/stdc++.h>

using namespace std;

long long x,n,i,t;

int main()

{

cin>>n;

t=0;

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

{

cin>>x;

if (x>0) t+=x;

}

cout<<t;

return 0;

}

#include <bits/stdc++.h>

using namespace std;

long long a[40],i,n,ln;

int main()

{

cin>>n;

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

{

cin>>a[i];

}

ln=a[1];

for (i=1; i<=n; i++) ln=max(ln,a[i]);

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

if (ln==a[i]) 

{

cout<<i;

break;

}

return 0;

}