一个5位数字ABCDE*4=EDCBA ,这5个数字不重复,输出这样的数字

#include<iostream>
#include<stack>
#include<algorithm>
#include<cmath>
using namespace std;
int reverse(int i)
{
 int resualt=0;
 stack<int>  mys;
 for(int j=4;j>=0;j--)
 {
  mys.push((i/(int)pow(10,j)));
  i=i%((int)pow(10,j));
 }
 for( j=4;j>=0;j--)
 {
  resualt+=(mys.top())*((int)pow(10,j));
  mys.pop();
 }
 return resualt;
}
int main()
{
 int j=reverse(12345);
 int i=10000;
 for(i=10000;i<100000;i++)
  if(i*4==reverse(i))
   cout<<i<<endl;
  return 0;
}

相关文章:

  • 2021-06-02
  • 2021-12-08
  • 2022-01-08
  • 2022-01-24
  • 2021-07-29
  • 2021-10-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2021-11-23
相关资源
相似解决方案