Posted by xvedejas on Fri 28 Nov 20:27
report abuse | download | new post
- using System;
- using System.Collections.Generic;
- namespace duplicates
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- int max = 10000;
- for ( int i = 0; i < max; i++ )
- {
- bool pass = true;
- foreach ( char character in i.ToString() )
- {
- if ( i.ToString().IndexOf( character ) != i.ToString().LastIndexOf( character ) )
- {
- pass = false;
- }
- }
- if ( pass ) { numbers.Add( i ); }
- }
- foreach ( int number in numbers ) { Console.WriteLine( number ); }
- }
- }
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.