#include<iostream> using namespace std ; int main () { 	int b[100],a,i=0,y,z=0,o=0,t=0; 	cout<<"the first  hundred hapPpPpPpy number are : "<<endl; 	for(int r=1 ; r<1000 ; r++) 	{     a=r; 	   do{  i=0; z=0; 	        for( i ; a!=0 ; i++ ) 		       { 			       b[i]=a%10 ; 			       a/=10 ; 		       } 	        for ( int s=0 ; s<i ; s++ ) 		       { 			y=b[s]*b[s] ; 			z+=y ; 	           } 	        a=z; 	     }while((z!=1)&&(z!=4)); 	        if(z==1)             	{cout<<r<<"     "; o+=1; t+=1; } 	        if(t==10) 	            { cout<<endl; t=0;} 	        if(o==100) break ; 	} return 0 ;	   }