这道题目来自小伙伴面试嵌入式工程师的一道题目,题目的要求: 在小于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
关注
打赏