Language: C++

#include <iostream>

using namespace std;

int main()
{
	int a, b;

	while (cin >> a >> b) {
		int sum = a + b;
#if 0
		int n;
		for (n = 0; sum > 0; n++) {
			sum /= 10;
		}
		cout << n << endl;
#else
		if        (n > 10000000) {		n = 8;	} 
		} else if (n > 1000000) {		n = 7;	}
		} else if (n > 100000) {		n = 6;	}
		} else if (n > 10000) {		n = 5;	}
		} else if (n > 1000) {		n = 4;	}
		} else if (n > 100) {		n = 3;	}
		} else if (n > 10) {		n = 2;	}
		} else if (n > 1) {			n = 1;	}
		} else {					n = 0;
		}
	
#endif
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: 'n' was not declared in this scope
   18 |                 if        (n > 10000000) {              n = 8;  }
      |                            ^
a.cc:19:19: error: 'else' without a previous 'if'
   19 |                 } else if (n > 1000000) {               n = 7;  }
      |                   ^~~~
a.cc:19:28: error: 'n' was not declared in this scope
   19 |                 } else if (n > 1000000) {               n = 7;  }
      |                            ^
a.cc: At global scope:
a.cc:20:19: error: expected unqualified-id before 'else'
   20 |                 } else if (n > 100000) {                n = 6;  }
      |                   ^~~~
a.cc:21:17: error: expected declaration before '}' token
   21 |                 } else if (n > 10000) {         n = 5;  }
      |                 ^
a.cc:21:19: error: expected unqualified-id before 'else'
   21 |                 } else if (n > 10000) {         n = 5;  }
      |                   ^~~~
a.cc:22:17: error: expected declaration before '}' token
   22 |                 } else if (n > 1000) {          n = 4;  }
      |                 ^
a.cc:22:19: error: expected unqualified-id before 'else'
   22 |                 } else if (n > 1000) {          n = 4;  }
      |                   ^~~~
a.cc:23:17: error: expected declaration before '}' token
   23 |                 } else if (n > 100) {           n = 3;  }
      |                 ^
a.cc:23:19: error: expected unqualified-id before 'else'
   23 |                 } else if (n > 100) {           n = 3;  }
      |                   ^~~~
a.cc:24:17: error: expected declaration before '}' token
   24 |                 } else if (n > 10) {            n = 2;  }
      |                 ^
a.cc:24:19: error: expected unqualified-id before 'else'
   24 |                 } else if (n > 10) {            n = 2;  }
      |                   ^~~~
a.cc:25:17: error: expected declaration before '}' token
   25 |                 } else if (n > 1) {                     n = 1;  }
      |                 ^
a.cc:25:19: error: expected unqualified-id before 'else'
   25 |                 } else if (n > 1) {                     n = 1;  }
      |                   ^~~~
a.cc:26:17: error: expected declaration before '}' token
   26 |                 } else {                                        n = 0;
      |                 ^
a.cc:26:19: error: expected unqualified-id before 'else'
   26 |                 } else {                                        n = 0;
      |                   ^~~~
a.cc:30:9: error: expected declaration before '}' token
   30 |         }
      |         ^
a.cc:31:9: error: expected unqualified-id before 'return'
   31 |         return 0;
      |         ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^