Created
June 16, 2014 16:41
-
-
Save ggmichaelgo/23af573abb3c36fabf39 to your computer and use it in GitHub Desktop.
Floyd
This file contains hidden or 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
import java.util.Scanner; | |
public class Floyd | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner input = new Scanner(System.in); | |
for(int n=0 ; n<3 ; n++) | |
{ | |
int number = input.nextInt(); | |
int row=1, column=0; | |
while(number>0) | |
{ | |
number--; | |
if(column == row) | |
{ | |
row++; | |
column=0; | |
} | |
column++; | |
} | |
System.out.println("R" + row + " C" + column); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment