#include <iostream> using namespace std; int yinzizhihe(int a){ int b = 0; for(int i = 1;i<a;i++){ if(a%i==0){ b = b+i; } } return b; } int main(){ int a = 4; int sum1 = 0; int b = 0; while(1){ b = yinzizhihe(a); sum1 = yinzizhihe(b); if(a==sum1 && b!=sum1){ cout<<a<<" "<<b; break; } a++; } return 0; }
标签:std,int,1154,namespace,yinzizhihe,using From: https://www.cnblogs.com/As10016/p/17080127.html