int a = 0, b = 1, d = 1, c = 6, e = 1; for( b = 1; b <= c; b ++) { do { e = d * e; d ++; } while( d <= b); a = a + e; } System.out.println ( a );