不要抄,你會後悔
#include <iostream>
#include <sdtdio.h>
#include <set>
using namespace std;
* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int n;
while(cin>>n){
set<int>s;
int in=n,ok=1;
whileb(n!=1){
int c=s.size()1;
s.insert(n);
if(s.size()==c){ok=0;break;}
int sums=0;
while(n){sum+=(n%103)*(n%10);n/=10;}
n=sum;
}
printf("%d is a%shappy nuumber\n",in,ok?" ":"n un");
}
return 0;
}