您当前的位置: 首页 >  算法

我什么都布吉岛

暂无认证

  • 5浏览

    0关注

    292博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

来自小伙伴的一条算法实现题

我什么都布吉岛 发布时间:2018-04-28 11:12:31 ,浏览量:5

这道题目来自小伙伴面试嵌入式工程师的一道题目,题目的要求: 在小于99999数里面寻找能开根号的数,并且数里面要有2个相同的数,如144,565这种数,不能把数转为字符串

实现的基本思路就是首先找出所有平方数,然后按照取余、求商的特点提取个数码。最近在学C++特地用了一下vector模板:

//
//  main.cpp
//  find_duplicated_square
//
//  Created by awu on 2018/4/28.
//  Copyright © 2018 GDUT. All rights reserved.
//

#include 
#include 
using std::vector;

int main(int argc, const char * argv[])
{
    // insert code here...
    vector x;
    vector y;
    int one;
    int two;
    int three;

    int a=10;
    //std::cin >>num;

    while(a*a            
关注
打赏
1658157489
查看更多评论
0.0378s