class vizsgalat2
{
public static void main(String args[])
{
int d = 6;
for( d = 6; d <= 998; d++ ){
int a = d / 100;
int b = (d - 100*a)/10;
int c = d - 100*a - 10* b;
if ( d % 7 == 0) {
System.out.print(d);
}
else if(a == 7 || b == 7 || c == 7){
System.out.print(d);
}
}
}
} |
Programozás > Gyakorlatok 1. >