Những câu hỏi liên quan
xzczwww22
Xem chi tiết
Hoàng Thị Minh Tuyết
Xem chi tiết
Anh Thư Nguyễn
Xem chi tiết
Lala
Xem chi tiết
Trương Huy Hoàng
13 tháng 12 2023 lúc 22:58

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
map<ll,ll> mp;
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    freopen("MAP1.INP","r",stdin);
    freopen("MAP1.OUT","w",stdout);
    ll n; cin >> n;
    ll a[n+5];
    for(ll i=1;i<=n;i++) cin >> a[i], mp[a[i]]++;
    for(pair<ll,ll> it:mp) cout << it.first << " " << it.second << "\n";
}

Chúc bạn học tốt!

Bình luận (0)
huynh chinh
Xem chi tiết
Nguyễn Lê Phước Thịnh
14 tháng 4 2022 lúc 22:03

#include <bits/stdc++.h>

using namespace std;

long long n,i;

bool kt;

int main()

{

freopen("checknto.inp","r",stdin);

freopen("checknto.out","w",stdout);

cin>>n;

kt=true;

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

if (n%i==0) kt=false;

if (kt==true && n>1) cout<<"YES";

else cout<<"NO";

return 0;

}

Bình luận (0)
Đào Tiến Đạt
Xem chi tiết
Đào Tiến Đạt
22 tháng 12 2020 lúc 15:00

C++ nha mn

 

 

 

 

Bình luận (0)
33. PHAN THỊ HỒNG THẮM 1...
Xem chi tiết
Ngọc Hồng
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 3 2022 lúc 14:48

#include <bits/stdc++.h>

using namespace std;

string st;

int d,i,dem;

int main()

{

freopen("xau.inp","r",stdin);

freopen("xau.out","w",stdout);

cin>>st;

d=st.length();

dem=0;

for (i=0; i<=d-1; i++)

if (st[i]=='a') dem++;

cout<<dem;

return 0;

}

Bình luận (0)
Thắng Huỳnh
Xem chi tiết
Tin dễ mà =))
23 tháng 8 2023 lúc 14:17

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int n,k;
    cin >> n >> k;
    int a[n];
    for (int i=0;i<n;i++)
        cin >> a[i];
    sort(a,a+n);
    cout << a[k-1];
    return 0;
}

Bình luận (0)