DailyProgrammer 280 Easy: Counting on Fingers
Overall, your code is really good :) Good job.

The thing that bothers me is the inconsistent weird indentation, but that's probably because of copying and pasting.


The 2 verifying conditions do the same thing, you can put them together, which reduces maintenance in the long term, although for such a small project it's not really important.

if (((input[a] - '0') &gt; (input[a + 1] - '0') &amp;&amp; (a + 1) &lt; oneHandLength) ||
    ((input[a + oneHandLength] - '0') &lt; (input[(a + oneHandLength) + 1] - '0') &amp;&amp; a + oneHandLength &gt; oneHandLength + 1));

Depending on the architecture, int is not guaranteed to cover the entire range of std::size_t, so you should use that as a type instead of int to avoid overflowing. This is not a problem now because you only have 10 fingers, but if you decide to add more... :)

std::size_t oneHandLength = (input.length() / 2) - 1;
//'auto' would also be possible if you want to

Don't use integers as booleans. It is better to clearly state that you want to check if the integer is greater than 0 (or equal to 1 in this case):

if (input[b] - '0' == 1);

Although using parenthesis reduces confusion, I think you are using too many of them:

if ((input[b] - '0')){
    ^              ^

if(((input[a] - '0') &gt; (input[a + 1] - '0')) &amp;&amp; ((a + 1) &lt; oneHandLength)){
   ^^              ^   ^                  ^^    ^^     ^                ^

You have inconsistent spacing, choose one and be consistent:

for(int a = 0; a &lt;= oneHandLength; ++a){
int main () {
if ((input[b] - '0')){
if(isValid){

You aren't including a newline after the last output, which can be a "problem" when run in a shell:

$ ./hands
$ 0111011100 is valid: 37 $ (command here - on same line!)



Minor thing: You don't need to return 0;, so you can remove it if you want to.