1. 

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 640 Selfnumbers
* Link: http://uva.onlinejudge.org/external/6/640.html
*
* @author Barny Porcio
* @version 1.0, 07/01/2010
*
* Method : -
* Status : Accepted
* Runtime: 1.008
*/
public class selfnumbers {

/**
* @param args
*/
public static void main(String[] args) {
boolean[] array = new boolean[1000001];
for (int i = 1; i<array.length;++i){
int selfnum = i;
int temp = i;
while(temp != 0){
selfnum += temp%10;
temp /= 10;
}
if (selfnum < array.length)
array[selfnum] = true;
}
for (int i = 1; i < array.length; ++i){
if (!array[i])
System.out.println(i);
}
}

}