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
cacovski's solution for 300: Integer Pair, written in Java
public class IntegerPair { public int count(int N) { String s; String br=""; int cnt=0; for(int t=10; t<=N; t++) { // br=t+""; s=t+""; for(int i=0; i<s.length(); i++) { if(s.length()>1) { br=s.substring(0,i)+s.substring(i+1); } if(t+Integer.parseInt(br)==N) { cnt++; } } } return cnt; } public static void main(String[] Cace) { IntegerPair in = new IntegerPair(); System.out.println(in.count(100000)); } }