Register
|
Login
Home
News
Competitions
Practice
How to
Rankings
Calendar
Arena
CodeFu 2007
CodeFu'07 Highlights
Jazoon'07 Highlights
Schedule
Rules
Prizes
Results
Competitions
»
Main CodeFu Competitons
»
CodeFu 2007
»
Results
CodeFu 2007 Results
CodeFu Final Round Results
bokic's solution for 300: Integer Pair, written in Java
public class IntegerPair { public int count(int N) { int count = 0; for(int c1 = 10; c1 <= N; c1++){ String tStrVal = Integer.toString(c1); for(int c2 = 0; c2 < tStrVal.length(); c2++) { String tStrVal2 = tStrVal.substring(0, c2); if (tStrVal.length() > c2 + 1) tStrVal2 += tStrVal.substring(c2 + 1); if (Integer.valueOf(tStrVal2) + c1 == N) count++; } } return count; } }