https://www.lanqiao.cn/problems/191/learning/?page=1&first_category_id=1&problem_id=191
#include<iostream>
using namespace std;
int main(){
int j,sum=0,n;
cin>>n;
for(int i=1;i<=n;i++){
j=i;
while(j){
if(j%10==2||j%10==1||j%10==9||j%10==0){
sum+=i;
break;
}
j/=10;
}
}
cout<<sum;
return 0;
}
https://www.lanqiao.cn/problems/152/learning/?page=1&first_category_id=1&problem_id=152
#include<iostream>
using namespace std;
const int N=1e6+3;
int main(){
int a,b,c,n,sum=0;
cin>>n;
cin>>a>>b>>c;
for(int i=1;i<=n;i++){
if(i%a!=0&&i%b!=0&&i%c!=0){
sum++;
}
}
cout<<sum;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int n, m;
map<int, int> mp;
int main()
{
cin >> n >> m;
for(int i = 1; i <= n * m; i ++)
{
int x;
cin >> x;
mp[x] ++;
if(mp[x] > (m * n) / 2)
{
cout << x << endl;
return 0;
}
}
return 0;
}