Skip to content

Instantly share code, notes, and snippets.

@oscarryz
Created May 23, 2014 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oscarryz/a6ab7bb6a132f7c53ad6 to your computer and use it in GitHub Desktop.
Save oscarryz/a6ab7bb6a132f7c53ad6 to your computer and use it in GitHub Desktop.
class Sum {
public static void main( String ... args ) {
int result = 0;
for ( char c : "10110".toCharArray() ) {
result += c - '0';
}
System.out.println(result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment