Created
April 24, 2014 20:20
-
-
Save kddlb/11268242 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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package resarg; | |
/** | |
* | |
* @author Kevin | |
*/ | |
public class Resarg { | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) { | |
int a = 9; | |
int b = 6; | |
int c = 0; | |
while (a != 0) { | |
if (a % 2 != 0) { | |
c = c + b; | |
} | |
a = a / 2; | |
b = b * 2; | |
} | |
System.out.println(c); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment