H2330819027


私信TA

用户名:dotcpp0701405

访问量:8003

签 名:

指向函数指针数组的指针int(*(*p[4]))(int int)

等  级
排  名 127
经  验 7441
参赛次数 1
文章发表 80
年  龄 18
在职情况 学生
学  校 Hzu university
专  业 软件工程

  自我简介:


#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>


using namespace std;
using ll=long long;
int res;
bool check(int n)
{
  int x=n;
  while(x>0)
  {
    int y=x%10;
    if(y==2||y==0||y==1||y==9)
    {
      return true;
    }
    else x/=10;
  }
  return false;
}

int main()
{
  int n;cin>>n;
  for(int i=1;i<=n;i++)
  {
    if(check(i))res+=i;
  }
  cout<<res;
  return 0;
}


 

0.0分

2 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区