# data[].attributes.body
#include <bits/stdc++.h>

using namespace std;

int a[100],n,chiso,chiso2;

int main()
{
cout<<"Nhap n: ";
cin>>n;
for(int i=1; i<=n; i++)
{
cout<<"a["<<i<<"] = ";
cin>>a[i];
}
cout<<"------------------------\nCac mang co trong phan tu: \n";
for(int i=1; i<=n; i++)
{
cout<<a[i]<<endl;
}
int max, secondmax;
if(a[1] > a[2])
{
max = a[1];
secondmax = a[2];
}
else
{
max = a[2];
secondmax = a[1];
}
for(int i = 2; i <= n; i++)
{
if(a[i] > max)
{
secondmax = max;
max = a[i];
chiso = i;
}
else if(a[i] > secondmax)
{
secondmax = a[i];
chiso2 = i;
}
}
cout<<"------------------------\nPhan tu lon nhat: "<<max;
cout<<"\n------------------------\nPhan tu lon thu nhi: "<<secondmax;
cout<<"\n------------------------\nVi tri cua phan tu lon nhat: "<<chiso;
cout<<"\n------------------------\nVi tri cua phan tu lon thu nhi: "<<chiso2;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i, tam;
cout<<"nhap n: ";
cin>>n;
int a[n];
for(i = 1 ; i <= n ; i++ )
{
cout<<"a["<<i<<"]= ";
cin>>a[i];
}
cout<<"\n";
// a,b,c
int x, dem = 0;
cout<<"nhap x : ";
cin>>x;
cout<<"Vi tri xuat hien : ";
for(int i = 1; i <= n; i++)
if(a[i] == x)
{
tam = i;
dem++;
cout<<i<<" ";
}
cout<<"\n"<<x<<" : co xuat hien trong mang "<<"\n";
cout<<"Va so lan xuat hien cua mang: "<<dem<<"\n";

}

# data[].attributes.body
#include <bits/stdc++.h>
using namespace std;

bool ngto(int n)
{
if(n<2)
return false;
for(int i=2;i<=sqrt(n);i++)
if(n%i==0)        return false ;
return true;
return 0;
}
int main ()
{
int a[100],i,n,dem=0;
cout<<"Moi ban nhap so can kiem tra : ";
cin >> n;
for(i=0;i<n;i++)
{
cin >> a[i];
}
cout <<"Cac phan tu vua nhap la : ";
for(i=0;i<n;i++)    cout << a[i] << "  ";
cout << endl;
for (i=0;i<n;i++)
if(ngto(a[i])==true)
dem++;
cout << "Co " << dem << " so nguyen to la: ";
for(i=0;i<n;i++)
if(ngto(a[i])==true)
cout << a[i] << "  ";
cout << endl;
return 0;
}

# data[].attributes.body
#include <bits/stdc++.h>
using namespace std;
int main ()
{

int a[100],i,n,x,dem=0;
cout<<"nhap n : ";
cin >> n ;
cout << "Nhap x : ";
cin >> x ;
for(i=0;i<n;i++){
cout<<"a["<<i<<"]=";
cin >> a[i];
}
cout <<"cac phan tu vua nhap la : ";
for(i=0; i<n; i++)
cout << a[i] << "  ";
cout << endl<<endl;
for (i=0;i<n;i++)
if(a[i]==x)
dem++;
cout << "So lan xuat hien cua " << x << " trong day so la: "<<dem <<endl;
if(dem>0)
{
cout << "Tai cac vi tri : ";
for(i=0;i<n;i++)
if(a[i]==x)
cout << i+1 << "  ";
}
else
cout << "Khong xuat hien trong day so ";
cout <<endl;
return 0;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i, tam;
cin>>n;
int a[n];
for(i = 1 ; i <= n ; i++ )
{
cout<<"a["<<i<<"]= ";
cin>>a[i];
}
cout<<"\n";
//a
int tonga = 0;
cout<<"CAC PHAN TU CHAN TRONG MANG  : "<<" ";
for(i = 1 ; i <= n ; i++ )
if(a[i] % 2 == 0)
{
cout<<a[i]<<" ";
tonga = tonga + a[i];
}
cout<<" Tong mang chan: "<<tonga<<"\n";
//b
int tongb = 0;
cout<<"CAC PHAN TU LE TRONG MANG : "<<" ";
for(i = 1 ; i <= n ; i++ )
if(a[i] % 2 != 0)
{
cout<<a[i]<<" ";
tongb = tongb + a[i];
}
cout<<" Tong mang le: "<<tongb<<"\n";
//c
int tongc = 0;
cout<<"CAC PHAN TU AM TRONG MANG : "<<" ";
for(i = 1 ; i <= n ; i++ )
if(a[i] < 0)
{
cout<<a[i]<<" ";
tongc = tongc + a[i];
}
cout<<" Tong mang am: "<<tongc<<"\n";
//d
int tongd = 0;
cout<<"CAC PHAN TU CHAN KHONG AM TRONG MANG  : "<<" ";
for(i = 1 ; i <= n ; i++ )
if(a[i] % 2 == 0 && a[i] > 0 )
{
cout<<a[i]<<" ";
tongd = tongd + a[i];
}
cout<<" Tong mang chan khong am: "<<tongd<<"\n";
//e
int tonge = 0;
cout<<"CAC PHAN TU LE KHONG AM TRONG MANG : "<<" ";
for(i = 1 ; i <= n ; i++ )
if(a[i] % 2 != 0 && a[i] > 0 )
{
cout<<a[i]<<" ";
tonge = tonge + a[i];
}
cout<<" Tong mang le: "<<tonge<<"\n";

}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
long n,dem=0,j;
long a[1000];
cout<<"nhap n=";
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
for(int i=1;i<=n;i++)
{
int x=a[i],kt=true;
if (x<2) kt=false;
else
if (x>=2 && x<4) kt=true;
else
{
for (j=2;j<=ceil(sqrt(x));j++)
if (x%j==0)
{
kt=false;
break;
}
}
if (kt==true) dem++;
}
cout<<dem;
return 0;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int ktnt(int a)
{
if(a<2)
return 0;
if(a==3)
return 1;
for(int i=2;i<=sqrt(a);i++)
{
if(a%i==0)
return 0;
}
return 1;
}
int main()
{
int n;
cin>>n;
int a[n];
for(int i = 1; i <= n; i++) cin >> a[i];
for(int i = 1; i <=n; i++) cout<<a[i]<<" ";
cout<<"\n";
int demchan = 0;
for(int i = 1; i <= n; i++)
if(a[i] % 2 == 0)
{
demchan++;
cout<<"Co so phan tu "<<i<<" la so chan";
cout<<" cac so chan: "<<a[i]<<" "<<"\n";
}
int demle = 0;
for(int i = 1; i <=n; i++)
if(a[i] % 2 != 0)
{
demle++;
cout<<"Co so phan tu "<<i<<" la so le";
cout<<" cac so le: "<<a[i]<<" "<<"\n";
}
for(int i = 1 ;i <=n; i++)
if(ktnt(a[i]) == 1)
cout<<a[i]<<" ";
for (int i = 2;i <= a[i]; i++)
{
if(a[i]<2) return 0;
else if(a[i]%i==0) return 0;
else
cout<<a[i]<<" ";
break;
}
return 0;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i, tam;
cin>>n;
int a[n];
for(i = 1 ; i <= n ; i++ )
{
cout<<"a["<<i<<"]= ";
cin>>a[i];
}
cout<<"\n";
int  tama, minn = a[1];
cout<<"\n";
for(int i = 1; i <= n; i++)
if(a[i] < minn)
{
minn = a[i];
tama = i;
}
cout<<"So be nhat trong mang : "<<minn<<" Chi so: "<<tama;

}

# data[].attributes.body
#include <iostream>

using namespace std;
int a,b,c;
int main()
{
cout << "Nhap a,b,c : " << endl;
cin>>a>>b>>c;
if (a>b&&a>c) cout<< "so lon nhat la"<<a
else if (b>a&&b>c) cout<< "so lon nhat la "<<b
else cout<< "so lon nhat la "<<c;
return 0;

# data[].attributes.body
#include <iostream>

using namespace std;
float a,b,c;

int main()
{
cout << "hay nhap a b va c : " << endl;
cin>>a>>b>>c;
if (a>0&&b>0&&c>0&&a+b>c&&a+c>b&&b+c>a)
cout<< "bo ba a b c tao thanh tam giac";

if ((a*a+b*b==c||a*a+c*c==b*b||b*b+c*c==a*a)&&(a==b||a==c||b==c))
cout<< "bo ba a b c tao thanh tam giac vuong can ";
else cout<< "bo ba a b c khong tao thanh tam giac vuong can";

return 0;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int n,i,b=0,c=0;
int a[100];
int main()
{
cout << "Moi ban nhap vao n : ";
cin >> n ;
for(i=1;i<=n;i++)
{
cout << "a["<<i<<"]=";
cin >>a[i];
}
cout << " cac phan tu :";
for(i=1;i<=n;i++)
cout << a[i] << "  ";
cout << endl;
cout << " cac phan tu chan : ";
for(i=1;i<=n;i++) if(a[i]%2==0)
{
cout<<a[i]<<"  ";
b++;
}
cout<<"so phan tu le la : ";
for(i=1;i<=n;i++) if(a[i]%2==1)
{
cout<<a[i]<<"  ";
c++;
}
return 0;
}

# data[].attributes.body
#include <bits/stdc++.h>

using namespace std;
int n,i,a[100],dem1=0,dem2=0;
int main()
{
cout << "nhap do dai cua mang=";cin>>n;
for(i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
cout<<"cac phan tu trong mang la: ";
for(i=1;i<=n;i++) cout<<a[i]<<" ";
cout<<endl;
cout<<"cac phan tu chan trong mang la: ";
for(i=1;i<=n;i++) if(a[i]%2==0) cout<<a[i]<<" ";
cout<<endl;
for(i=1;i<=n;i++) if(a[i]%2==0) dem1++;
cout<<"so phan tu chan trong day la: "<<dem1;
cout<<endl;
cout<<"cac phan tu le trong mang la: ";
for(i=1;i<=n;i++) if(a[i]%2!=0) cout<<a[i]<<" ";
cout<<endl;
for(i=1;i<=n;i++) if(a[i]%2!=0) dem2++;
cout<<"so phan tu le trong day la: "<<dem2;
}

# data[].attributes.headline
(*￣3￣)╭thầy ơi cho em nghỉ sớm vì mai em thi Bài 2 Tác Giả: Nguyên

# data[].attributes.subject
(*￣3￣)╭thầy ơi cho em nghỉ sớm vì mai em thi Bài 2 Tác Giả: Nguyên

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int n,minn,csmin=1;
float a[100];
int main()
{
cout<<"nhap n:";
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
minn=a[1];
for(int i=1;i<=n;i++)
if(minn>a[i])
{
minn=a[i];
csmin=i;
}
cout<<"phan tu be nhat la : "<<minn<<endl;
cout<<"chi so mang la : "<<csmin;
return 0;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,dem=0;
int a[100];
cout<<"nhap n:";
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
for(int i=1;i<=n;i++)
if(a[i]%2==1)
{
cout<<a[i]<<"  ";
dem++;
}
cout<<"so phan tu le la : "<<dem;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,dem=0;
int a[100];
cout<<"nhap n:";
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
for(int i=1;i<=n;i++)
if(a[i]%2==0)
{
cout<<a[i]<<"  ";
dem++;
}
cout<<"so phan tu chan la : "<<dem;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
float a[100];
cout<<"nhap n:";
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
for(int i=1;i<=n;i++)
cout<<a[i]<<"  ";
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
float a[100];
int n,csminn,i,minn;
int main()
{
cout << "Moi ban nhap kinh thuoc mang n : ";
cin >> n ;
for(i=1;i<=n;i++)
{
cout << "a["<<i<<"]=";
cin >> a[i];
}
minn = a[1]; csminn =1;
for(int i = 1; i <= n; i++)
if(a[i] < minn)
{
minn = a[i];
csminn = i;
}
cout << " phan tu be nhat : " << minn << endl ;
cout << " chi so mang : " << csminn ;
return 0;
}

# data[].attributes.body
#include <iostream>

using namespace std;
float a[100],maxx;
int n,csmax,i;
int main()
{
cout << "Moi ban nhap kinh thuoc mang n = ";
cin>>n ;
for(i=0;i<n;i++)
{
cout << "a["<<i<<"]=";
cin >> a[i];
}
for(i=0;i<n;i++)
cout << a[i] << "  " << endl;
maxx = a[0], csmax =0;
for(int i = 1; i < n; i++)
if(a[i] > maxx)
{

maxx = a[i];
csmax = i;
}

cout << " phan tu lon nhat  " << maxx ;
cout << " co chi so  " << csmax ;

return 0;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int n,i,minn,csmin;
float a[100];
int main()
{
cout<<"nhap do dai mang= ";cin>>n;
for(i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";cin>>a[i];
}
int minn = a[1], csmin =1;
for(int i = 2; i <= n; i++)
if(a[i] < minn)
{
minn = a[i];
csmin = i;
}
cout <<"phan tu co gia tri be nhat la: "<<minn<<endl;
cout<<"vi tri: "<<csmin;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
float a[n];
for(int i = 1; i <= n; i++) cin >> a[i];
int minn = a[1], chiso=1;
for(int i = 2; i <= n; i++)
{
if(a[i] < minn)
{
minn = a[i];
chiso = i;
}
}
cout<<"Min : "<<minn<<"; STT: "<<chiso;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
float a[100],maxx;
int n,csmax,i;
int main()
{
cout << "Moi ban nhap kinh thuoc mang n : ";
cin >> n ;
for(i=0;i<n;i++)
{
cout << "a["<<i<<"]=";
cin >> a[i];
}
for(i=0;i<n;i++)
cout << a[i] << "  " << endl;
maxx = a[0], csmax =0;
for(int i = 1; i < n; i++)
if(a[i] > maxx)
{
maxx = a[i];
csmax = i;
}
cout << " phan tu lon nhat : " << maxx << endl ;
cout << " chi so mang : " << csmax ;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int n,i,maxx,csmax;
float a[100];
int main()
{
cout<<"nhap do dai mang= ";cin>>n;
for(i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";cin>>a[i];
}
int maxx = a[0], csmax =0;
for(i=1;i<=n; i++)
if(a[i] > maxx)
{
maxx = a[i];
csmax = i;
}
cout <<"phan tu có gia tri lon nhat la: "<<maxx<<endl;
cout<<"vi tri: "<<csmax;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,minn,csmin=1;
float a[100];
cout<<"nhap n:";
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
minn=a[1];
for(int i=1;i<=n;i++)
if(minn>a[i])
{
minn=a[i];
csmin=i;
}
cout<<"phan tu be nhat la : "<<minn<<endl;
cout<<"chi so mang la : "<<csmin;
return 0;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int n,maxx,csmax=1;
float a[100];
int main()
{
cout<<"nhap n:";
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
maxx=a[1];
for(int i=1;i<=n;i++)
if(maxx<a[i])
{
maxx=a[i];csmax=1;
csmax=i;
}
cout<<"phan tu lon nhat la : "<<maxx<<endl;
cout<<"chi so mang la : "<<csmax;
return 0;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,maxx,csmax=1;
float a[100];
cout<<"nhap n:";
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
maxx=a[1];
for(int i=1;i<=n;i++)
if(maxx<a[i])
{
maxx=a[i];csmax=1;
csmax=i;
}
cout<<"phan tu lon nhat la : "<<maxx<<endl;
cout<<"chi so mang la : "<<csmax;
return 0;
}

# data[].attributes.body
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
float a[n];
for(int i = 1; i <= n; i++) cin >> a[i];
int maxx = a[1], csmax =1;
for(int i = 2; i <= n; i++)
if(a[i] > maxx)
{
maxx = a[i];
csmax = i;
}
cout <<" Max = "<<maxx<<"; STT: "<<csmax;
}