It's hard to understand what you are trying to do.
Your code doesn't help since it doesn't make sense to test the exact same condition over and over in an if/else if construct.
Do you want all permutations of 5 byte values which exclude byte values whose hex representation doesn't contain a letter?
Why do you only want those values?
Why do you want them in descending order?
What exactly do you want to do with them?
One way to permute the values:
Code:
for (int a = 0xFF; a >= 0; --a) {
if (a / 0x10 < 0xA && a % 0x10 < 0xA) continue;
for (int b = 0xFF; b >= 0; --b) {
if (b / 0x10 < 0xA && b % 0x10 < 0xA) continue;
for (int c = 0xFF; c >= 0; --c) {
if (c / 0x10 < 0xA && c % 0x10 < 0xA) continue;
for (int d = 0xFF; d >= 0; --d) {
if (d / 0x10 < 0xA && d % 0x10 < 0xA) continue;
for (int e = 0xFF; e >= 0; --e) {
if (e / 0x10 < 0xA && e % 0x10 < 0xA) continue;
// use a,b,c,d,e here
}
}
}
}
}
I used the continues instead of the opposite condition and braces to limit the indentation and stair stepping.
EDIT: It's not so bad with a 2-space tab and leaving out most of the braces when not needed:
Code:
for (int a = 0xFF; a >= 0xA; --a)
if (a / 0x10 >= 0xA || a % 0x10 >= 0xA))
for (int b = 0xFF; b >= 0xA; --b)
if (b / 0x10 >= 0xA || b % 0x10 >= 0xA))
for (int c = 0xFF; c >= 0xA; --c)
if (c / 0x10 >= 0xA || c % 0x10 >= 0xA))
for (int d = 0xFF; d >= 0xA; --d)
if (d / 0x10 >= 0xA || d % 0x10 >= 0xA))
for (int e = 0xFF; e >= 0xA; --e)
if (e / 0x10 >= 0xA || e % 0x10 >= 0xA)) {
// use a,b,c,d,e here
}