Created
May 23, 2014 17:06
-
-
Save oscarryz/a6ab7bb6a132f7c53ad6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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