От 0000 до 9999

Discussion in 'Болталка' started by хoхa99, 12 Jul 2011.

  1. хoхa99

    хoхa99 Member

    Joined:
    24 Jan 2010
    Messages:
    57
    Likes Received:
    5
    Reputations:
    0
    какая программа делает список от 0000 до 9999, тоесть 0001, 0002 в столбик, кроме excel
     
  2. Maеstro

    Maеstro Member

    Joined:
    12 May 2010
    Messages:
    51
    Likes Received:
    9
    Reputations:
    0
    генератор icq password :D
     
  3. хoхa99

    хoхa99 Member

    Joined:
    24 Jan 2010
    Messages:
    57
    Likes Received:
    5
    Reputations:
    0
    ссылку прошу..
     
  4. ride

    ride New Member

    Joined:
    18 Apr 2010
    Messages:
    26
    Likes Received:
    4
    Reputations:
    0
    http://files-my.narod.ru/list.txt
    это готовый список :)
    p.s. подобное можно сделать через командную строку винды, только начинается список будет не с 0001, а просто с 1:
    Code:
    for /l %d in (0,1,9999) do echo %d >> c:\list.txt
     
    #4 ride, 12 Jul 2011
    Last edited: 12 Jul 2011
  5. patcher

    patcher Banned

    Joined:
    15 Dec 2009
    Messages:
    190
    Likes Received:
    37
    Reputations:
    10
    http://www.sendspace.com/file/907aw6
    вот список

    +++
    фак, опередили :D
     
  6. хoхa99

    хoхa99 Member

    Joined:
    24 Jan 2010
    Messages:
    57
    Likes Received:
    5
    Reputations:
    0
    хорошие рыбки на главной, спс
     
  7. skM

    skM New Member

    Joined:
    27 Jun 2010
    Messages:
    20
    Likes Received:
    1
    Reputations:
    0
    такое можно самому написать. меньше, чем за минуту =\
     
    #7 skM, 12 Jul 2011
    Last edited: 12 Jul 2011
  8. .while

    .while Member

    Joined:
    22 Feb 2010
    Messages:
    40
    Likes Received:
    5
    Reputations:
    0
    хоть не заходи в болталку ёп
    человек просить помочь, лучше чем выебыв*ться лишний раз, помог бы
     
  9. FewG

    FewG Member

    Joined:
    25 Dec 2009
    Messages:
    136
    Likes Received:
    12
    Reputations:
    0
    Простенький скрипт на питоне :D Даже ставит нули впереди числа в зависимости от кол-ва символов верхнего предела:

    Code:
    MIN = 0
    MAX = 1000
    
    for i in range (MIN, MAX + 1):
        length = len(str(MAX))
        cur_length = len(str(i))
        zero = length - cur_length
        
        print("0" * zero + str(i))
    
    Code:
    0000
    0001
    0002
    0003
    0004
    0005
    0006
    0007
    0008
    0009
    0010
    0011
    0012
    0013
    0014
    0015
    0016
    ...
     
  10. Skofield

    Skofield Elder - Старейшина

    Joined:
    27 Aug 2008
    Messages:
    960
    Likes Received:
    392
    Reputations:
    58
    PHP:
    <?php 
    for ($i=0$i<=9999$i++){ 
        
    $n sprintf("%04d"$i);
        echo 
    $n."<br>\n";
    }
    ?>
     
  11. 1n0y

    1n0y Active Member

    Joined:
    9 May 2009
    Messages:
    276
    Likes Received:
    282
    Reputations:
    2
    бляяя, зачем ты это написал?! я же теперь ближайшие сутки буду написать эту песню :((
     
  12. krypt3r

    krypt3r Elder - Старейшина

    Joined:
    27 Apr 2007
    Messages:
    1,507
    Likes Received:
    389
    Reputations:
    101
    perl -le 'print sprintf "%04s", $_ for 0 .. 9999' > 0000.txt
     
  13. Ponchik

    Ponchik Хлебо-булочное изделие

    Joined:
    30 Aug 2005
    Messages:
    687
    Likes Received:
    807
    Reputations:
    311
    остался скрипт на ASM, кто напишет? :D
     
  14. Alexandr II

    Alexandr II -=ImperatoR=-

    Joined:
    28 Dec 2007
    Messages:
    1,067
    Likes Received:
    670
    Reputations:
    87
    может еще на дельфи написать, не скомпилиный? :)
     
  15. Godfather Bulan

    Godfather Bulan Elder - Старейшина

    Joined:
    18 Mar 2008
    Messages:
    172
    Likes Received:
    443
    Reputations:
    25
    Да не вопрос!
    Code:
    procedure TForm1.FormCreate(Sender: TObject);
    var
    i,a,b:integer;
    begin
    memo1.text:='';
    a:=0;
    b:=9999;
    for i := a to b do
    Memo1.Lines.Add(Format('%*.*d', [0, 4, (i)]));
    end;
     
  16. Ins3t

    Ins3t Харьковчанин

    Joined:
    18 Jul 2009
    Messages:
    939
    Likes Received:
    429
    Reputations:
    139
    а хуле

    Code:
    #include <iostream>
    #include <fstream>
    #include <iomanip>
    
    int main() {
    	std::ofstream out_file( "D:\\file.txt", std::ios::out );
    
    	if( !out_file ) {
    		std::cerr << "Can't open file!\n";
    		return 1;
    	}
    
    	for( int i = 0; i <= 9999; ++i ) {
    		out_file << std::setfill( '0' ) << std::setw( 4 ) << i << std::endl;
    	}
    
    	return 0;
    }
    
     
  17. sn0w

    sn0w Статус пользователя:

    Joined:
    26 Jul 2005
    Messages:
    1,023
    Likes Received:
    1,309
    Reputations:
    327
    на асме?) да запросто))

    Code:
    include 'c:\fasm\include\win32ax.inc' ; you can simply switch between win32ax, win32wx, win64ax and win64wx here
    
    .code
      start:
    	
    	push	ebp
    	mov		ebp, esp
    	
    	;handle  -24
    	;lpdw   -20
    	;counter -16
    	;str -12
    	
    	sub		esp, 24
    	xor		eax, eax
    	push	eax
    	push	eax
    	push	CREATE_ALWAYS
    	push	eax
    	push	FILE_SHARE_WRITE
    	push	GENERIC_WRITE
    	push	s_file
    	call	[CreateFileA]
    	cmp		eax, INVALID_HANDLE_VALUE
    	jz		err0
    	mov		[ebp-24], eax
    	mov		dword [ebp-16], 0
    l1:	
    	push	dword [ebp-16]
    	push	s_format
    	lea		edx, [ebp-12]
    	push	edx
    	call	[wsprintfA]
    	add		esp, 12
    	push	0
    	lea		edx, [ebp-20]
    	push	edx
    	push	6
    	lea		edx, [ebp-12]
    	push	edx
    	push	dword [ebp-24]
    	call	[WriteFile]
    	inc		dword [ebp-16]
    	cmp		dword [ebp-16], 9999
    	jng		l1
    	push	dword [ebp-24]
    	call	[CloseHandle]
    	jmp		exit
    err0:
    	inc		eax
    	push	eax
    	push	eax
    	push	s_error
    	push	eax
    	call	[MessageBoxA]
    exit:	
    	mov		esp, ebp
    	pop		ebp
    	xor		eax, eax
    	push	eax
    	call	[ExitProcess]
    .end start
    
    .data
    s_format db '%04d',0dh,0ah,0
    s_file   db 'lolo.txt', 0
    s_error	 db 'Error creating file!',0
    ; забыл про вдруг не откроется))
    
     
    #17 sn0w, 13 Jul 2011
    Last edited: 13 Jul 2011
  18. ЕгоАкк

    ЕгоАкк Banned

    Joined:
    21 Sep 2009
    Messages:
    84
    Likes Received:
    18
    Reputations:
    0
    Безумные умения
     
  19. SeNaP

    SeNaP Elder - Старейшина

    Joined:
    7 Aug 2008
    Messages:
    378
    Likes Received:
    69
    Reputations:
    20
    Тоже хочу :D
    PHP:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.IO;

    namespace 
    ConsoleApplication2
    {
        class 
    Program
        
    {
            static 
    void Main(string[] args)
            {
                
    StreamWriter sw = new StreamWriter("result.txt");
                for (
    int i 0<= 9999i++)
                {
                   
    sw.WriteLine("{0:0000}"i);
                }
                
    sw.Close();
            }
        }
    }
     
  20. Ins3t

    Ins3t Харьковчанин

    Joined:
    18 Jul 2009
    Messages:
    939
    Likes Received:
    429
    Reputations:
    139
    Это уже не просто флешмоб, это вошло в традицию! :)