Register
|
Login
Home
News
Competitions
Practice
How to
Rankings
Calendar
Arena
CodeFu 2010
CodeFu'10 Highlights
Jazoon'10 Highlights
Schedule
Rules
Prizes
Results
Competitions
»
Main CodeFu Competitons
»
CodeFu 2010
»
Results
CodeFu 2010 Results
Final Round Results
digitalis's solution for 300: NumberSequence, written in Java, submitted on 09.05.2010 12:57:43
public class NumberSequence { /** * @param args */ public static int findDigit(int N) { int br=0; int count=0; while (br<N) { count++; br+=count; } int pom=0; StringBuffer bf=new StringBuffer(); for (int i=1;i<=count;i++) { for(int j=1;j<=i;j++) bf.append(j); } String str=bf.toString(); char ch=str.charAt(N-1); bf=new StringBuffer(); bf.append(ch); str=bf.toString(); int in=Integer.parseInt(str); return in; } }