Sčítání Binárních čísel – C / C++ – Fórum – Programujte.com
 x   TIP: Přetáhni ikonu na hlavní panel pro připnutí webu

Sčítání Binárních čísel – C / C++ – Fórum – Programujte.comSčítání Binárních čísel – C / C++ – Fórum – Programujte.com

 

Petr
~ Anonymní uživatel
746 příspěvků
11. 11. 2014   #1
-
0
-

Zdravím 

začínám s C++ a za úlohu jsme dostali vytvořit program co sčítá binární čísla ...

Program jsem realizoval nejdříve tím, že jsem je převáděl na dekadická a sečetl a pak zase zpět ... nicméně učitel na mě vyzrál a dal tam tak veliké rozsahy, že jsem musel sčítání provést jako porovnávání 2 stringů ... 

No program mi funguje ale je tam bonusová část s kterou si nevím rady a potřeboval bych nasměrovat jak si s ní poradit. 

Vstupem pro je toto: 

<code>0010110110110000100011011100100000010111000110011101110110100101010101101101111011001110011000101110000001010001000000010001001110011111000101000010000010101000011010101110011000011100101011101100101111001110111111001101011101000100010001111001111000111011001011111111101001001000111011000100000111011001110111100011111110001110100110011100101111011011001010011101100011101011110100110101011001101001101100110100100101111000101000010100100011011111011010001001100100001101100110100011100111001101110110110101000011101110010010101100010010101110111011000100001111100000110000001111110001101101000100101111011100000001001110100000000101101011100011111000010010000001001101010101111000100001011100100001110011101011000001011001001010010111010111111000011111100111101111000100111111000011101011001000101100011111000001001001110111110100100000010000011001110111000000000000100000011011101111000101010010000011000100010100101110000101001011111010101111001101111110011000111101011010101011100110111000001010111111000101000100110111111111100011001001111100010001101000010100001010010001110001000111010000000010011100101001001010000011101010110100000000100111110100100001100100010101101111101111000001010010100000111110001000100111000111101010111010111010111001100101001111101110110100000000111100010000101000110001010010001110001010010100101111100011001010011101010100100000100001100010010111001100001100101100110100101110000011101001110101101111111111100100000110100110101111000001011010100011000010101001001001111111001111111111001010011111011110101110110110001111001110111010111010110100001011001111111101100010100110100111110010111000111100011000111110111101010110001001110011011110101101100101001011001000011101001001000001111001111101010111101010110111011011000000100010000010100110000011011010010010011001011000000001111110100000101000111110000100010011011110111000100100111110000000110111111011101101000111001100111010100011110011001011000101001010110001110110011111100000011010110100011111000010010001010111101111101011110000001110000011010100111101110011000011110001110111111100001011010000000001100100111000111000001000011101001010110010000011010101111110111111000010101101011111111111011001100011111001101011011101101011100001000010111001111011101010101011110110110100101111111101110111001100111100100111111111010110101011101100100100001111101110101010111111111100110001010010000111111000001011000110101111001110011101000000011000100010111101101011111101011000101111011101011110001001100010001101010100110000111100010100110100101110101110111100111001000011100011011001011011110111000110110101111110111111001101011010100001011011001011100110010001011111100110001011100101101101001101100000111100000001111010000000011100010001010010011100011110000010100110010110011101100100000010111100000000011000111100011010011011111111100111001010001000001011101000011000001110010001111001100000010110100001111000000101000101111011011100101001001011001111101101011111010000001100111000000110010100010110100001000111110010111100101111100100011000010100100100011011000111010110110110111001111100001100001110101111100000000011011111110000001010111110101111111101000011110101001000000111011000100000100100011001010010101010010100010000110111000100101000011100010101011101001110001001001011001001111010101101001010110010001000010010110010101011011110111000010101100111000111010110010100010011010011011010111001100000010000000000011101000111110010001110000011111101101001001000101101100011100110010000100000101101011001111000110010010001100011111101101000010010101001100011111001010010011001011100001001111100000110001000111110011001101010101010111101000000010011111011010010111100110011000000110000100110010110000101001101011101011001110000100010011101100100100101100101000100010010001101010100101110101110101100010000011001000001111001000111000110010110101000010111001100010000000010110100110100110101100111111010110010100100010111111011011100110110011100010111010111101010011100011111111001010011110001111100101111111000111011001111110000011001101101110000001100101001011010000010001101011110110000001111111101011111110001010011000110001111010000110000110110100000000111000010100001001011101001010100011100010111011111010101111110111000101101101001101111110101010110010010100001000011001000111100101010110100101110111100111010011111100010100010110000100001111110011111110111100110101101110100011010001001000111001101011111100101111110110000010011111011001101111011000000000100011011101101100110001101011001111110101110000011010110110011000001001000011001100000100000100001111100111010011100000111110101100100101110101011000001100001001110101000100010101111111101011110000001100001011000111001100010011111010011011100111010000010010001100011000101001011110010110001000111111101010010001000110001011000110010111111010110101101000010011011001001000000101010101001101010000111011000101111001101011111001010000110101100011001110110101100111110001000101101111010011010101001000100110000101001011011011000010001101110010000001011100011001110111011010010101010110110111101100111001100010111000000101000100000001000100111001111100010100001000001010100001101010111001100001110010101110110010111100111011111100110101110100010001000111100111100011101100101111111110100100100011101100010000011101100111011110001111111000111010011001110010111101101100101001110110001110101111010011010101100110100110110011010010010111100010100001010010001101111101101000100110010000110110011010001110011100110111011011010100001110111001001010110001001010111011101100010000111110000011000000111111000110110100010010111101110000000100111010000000010110101110001111100001001000000100110101010111100010000101110010000111001110101100000101100100101001011101011111100001111110011110111100010011111100001110101100100010110001111100000100100111011111010010000001000001100111011100000000000010000001101110111100010101001000001100010001010010111000010100101111101010111100110111111001100011110101101010101110011011100000101011111100010100010011011111111110001100100111110001000110100001010000101001000111000100011101000000001001110010100100101000001110101011010000000010011111010010000110010001010110111110111100000101001010000011111000100010011100011110101011101011101011100110010100111110111011010000000011110001000010100011000101001000111000101001010010111110001100101001110101010010000010000110001001011100110000110010110011010010111000001110100111010110111111111110010000011010011010111100000101101010001100001010100100100111111100111111111100101001111101111010111011011000111100111011101011101011010000101100111111110110001010011010011111001011100011110001100011111011110101011000100111001101111010110110010100101100100001110100100100000111100111110101011110101011011101101100000010001000001010011000001101101001001001100101100000000111111010000010100011111000010001001101111011100010010011111000000011011111101110110100011100110011101010001111001100101100010100101011000111011001111110000001101011010001111100001001000101011110111110101111000000111000001101010011110111001100001111000111011111110000101101000000000110010011100011100000100001110100101011001000001101010111111011111100001010110101111111111101100110001111100110101101110110101110000100001011100111101110101010101111011011010010111111110111011100110011110010011111111101011010101110110010010000111110111010101011111111110011000101001000011111100000101100011010111100111001110100000001100010001011110110101111110101100010111101110101111000100110001000110101010011000011110001010011010010111010111011110011100100001110001101100101101111011100011011010111111011111100110101101010000101101100101110011001000101111110011000101110010110110100110110000011110000000111101000000001110001000101001001110001111000001010011001011001110110010000001011110000000001100011110001101001101111111110011100101000100000101110100001100000111001000111100110000001011010000111100000010100010111101101110010100100101100111110110101111101000000110011100000011001010001011010000100011111001011110010111110010001100001010010010001101100011101011011011011100111110000110000111010111110000000001101111111000000101011111010111111110100001111010100100000011101100010000010010001100101001010101001010001000011011100010010100001110001010101110100111000100100101100100111101010110100101011001000100001001011001010101101111011100001010110011100011101011001010001001101001101101011100110000001000000000001110100011111001000111000001111110110100100100010110110001110011001000010000010110101100111100011001001000110001111110110100001001010100110001111100101001001100101110000100111110000011000100011111001100110101010101011110100000001001111101101001011110011001100000011000010011001011000010100110101110101100111000010001001110110010010010110010100010001001000110101010010111010111010110001000001100100000111100100011100011001011010100001011100110001000000001011010011010011010110011111101011001010010001011111101101110011011001110001011101011110101001110001111111100101001111000111110010111111100011101100111111000001100110110111000000110010100101101000001000110101111011000000111111110101111111000101001100011000111101000011000011011010000000011100001010000100101110100101010001110001011101111101010111111011100010110110100110111111010101011001001010000100001100100011110010101011010010111011110011101001111110001010001011000010000111111001111111011110011010110111010001101000100100011100110101111110010111111011000001001111101100110111101100000000010001101110110110011000110101100111111010111000001101011011001100000100100001100110000010000010000111110011101001110000011111010110010010111010101100000110000100111010100010001010111111110101111000000110000101100011100110001001111101001101110011101000001001000110001100010100101111001011000100011111110101001000100011000101100011001011111101011010110100001001101100100100000010101010100110101000011101100010111100110101111100101000011010110001100111011010110011111000100010110111101001101010100100010011000010010110110110000100011011100100000010111000110011101110110100101010101101101111011001110011000101110000001010001000000010001001110011111000101000010000010101000011010101110011000011100101011101100101111001110111111001101011101000100010001111001111000111011001011111111101001001000111011000100000111011001110111100011111110001110100110011100101111011011001010011101100011101011110100110101011001101001101100110100100101111000101000010100100011011111011010001001100100001101100110100011100111001101110110110101000011101110010010101100010010101110111011000100001111100000110000001111110001101101000100101111011100000001001110100000000101101011100011111000010010000001001101010101111000100001011100100001110011101011000001011001001010010111010111111000011111100111101111000100111111000011101011001000101100011111000001001001110111110100100000010000011001110111000000000000100000011011101111000101010010000011000100010100101110000101001011111010101111001101111110011000111101011010101011100110111000001010111111000101000100110111111111100011001001111100010001101000010100001010010001110001000111010000000010011100101001001010000011101010110100000000100111110100100001100100010101101111101111000001010010100000111110001000100111000111101010111010111010111001100101001111101110110100000000111100010000101000110001010010001110001010010100101111100011001010011101010100100000100001100010010111001100001100101100110100101110000011101001110101101111111111100100000110100110101111000001011010100011000010101001001001111111001111111111001010011111011110101110110110001111001110111010111010110100001011001111111101100010100110100111110010111000111100011000111110111101010110001001110011011110101101100101001011001000011101001001000001111001111101010111101010110111011011000000100010000010100110000011011010010010011001011000000001111110100000101000111110000100010011011110111000100100111110000000110111111011101101000111001100111010100011110011001011000101001010110001110110011111100000011010110100011111000010010001010111101111101011110000001110000011010100111101110011000011110001110111111100001011010000000001100100111000111000001000011101001010110010000011010101111110111111000010101101011111111111011001100011111001101011011101101011100001000010111001111011101010101011110110110100101111111101110111001100111100100111111111010110101011101100100100001111101110101010111111111100110001010010000111111000001011000110101111001110011101000000011000100010111101101011111101011000101111011101011110001001100010001101010100110000111100010100110100101110101110111100111001000011100011011001011011110111000110110101111110111111001101011010100001011011001011100110010001011111100110001011100101101101001101100000111100000001111010000000011100010001010010011100011110000010100110010110011101100100000010111100000000011000111100011010011011111111100111001010001000001011101000011000001110010001111001100000010110100001111000000101000101111011011100101001001011001111101101011111010000001100111000000110010100010110100001000111110010111100101111100100011000010100100100011011000111010110110110111001111100001100001110101111100000000011011111110000001010111110101111111101000011110101001000000111011000100000100100011001010010101010010100010000110111000100101000011100010101011101001110001001001011001001111010101101001010110010001000010010110010101011011110111000010101100111000111010110010100010011010011011010111001100000010000000000011101000111110010001110000011111101101001001000101101100011100110010000100000101101011001111000110010010001100011111101101000010010101001100011111001010010011001011100001001111100000110001000111110011001101010101010111101000000010011111011010010111100110011000000110000100110010110000101001101011101011001110000100010011101100100100101100101000100010010001101010100101110101110101100010000011001000001111001000111000110010110101000010111001100010000000010110100110100110101100111111010110010100100010111111011011100110110011100010111010111101010011100011111111001010011110001111100101111111000111011001111110000011001101101110000001100101001011010000010001101011110110000001111111101011111110001010011000110001111010000110000110110100000000111000010100001001011101001010100011100010111011111010101111110111000101101101001101111110101010110010010100001000011001000111100101010110100101110111100111010011111100010100010110000100001111110011111110111100110101101110100011010001001000111001101011111100101111110110000010011111011001101111011000000000100011011101101100110001101011001111110101110000011010110110011000001001000011001100000100000100001111100111010011100000111110101100100101110101011000001100001001110101000100010101111111101011110000001100001011000111001100010011111010011011100111010000010010001100011000101001011110010110001000111111101010010001000110001011000110010111111010110101101000010011011001001000000101010101001101010000111011000101111001101011111001010000110101100011001110110101100111110001000101101111010011010101001000100110000101001011011011000010001101110010000001011100011001110111011010010101010110110111101100111001100010111000000101000100000001000100111001111100010100001000001010100001101010111001100001110010101110110010111100111011111100110101110100010001000111100111100011101100101111111110100100100011101100010000011101100111011110001111111000111010011001110010111101101100101001110110001110101111010011010101100110100110110011010010010111100010100001010010001101111101101000100110010000110110011010001110011100110111011011010100001110111001001010110001001010111011101100010000111110000011000000111111000110110100010010111101110000000100111010000000010110101110001111100001001000000100110101010111100010000101110010000111001110101100000101100100101001011101011111100001111110011110111100010011111100001110101100100010110001111100000100100111011111010010000001000001100111011100000000000010000001101110111100010101001000001100010001010010111000010100101111101010111100110111111001100011110101101010101110011011100000101011111100010100010011011111111110001100100111110001000110100001010000101001000111000100011101000000001001110010100100101000001110101011010000000010011111010010000110010001010110111110111100000101001010000011111000100010011100011110101011101011101011100110010100111110111011010000000011110001000010100011000101001000111000101001010010111110001100101001110101010010000010000110001001011100110000110010110011010010111000001110100111010110111111111110010000011010011010111100000101101 <skipping 136154 B> 010110101100111100011001001000110001111110110100001001010100110001111100101001001100101110000100111110000011000100011111001100110101010101011110100000001001111101101001011110011001100000011000010011001011000010100110101110101100111000010001001110110010010010110010100010001001000110101010010111010111010110001000001100100000111100100011100011001011010100001011100110001000000001011010011010011010110011111101011001010010001011111101101110011011001110001011101011110101001110001111111100101001111000111110010111111100011101100111111000001100110110111000000110010100101101000001000110101111011000000111111110101111111000101001100011000111101000011000011011010000000011100001010000100101110100101010001110001011101111101010111111011100010110110100110111111010101011001001010000100001100100011110010101011010010111011110011101001111110001010001011000010000111111001111111011110011010110111010001101000100100011100110101111110010111111011000001001111101100110111101100000000010001101110110110011000110101100111111010111000001101011011001100000100100001100110000010000010000111110011101001110000011111010110010010111010101100000110000100111010100010001010111111110101111000000110000101100011100110001001111101001101110011101000001001000110001100010100101111001011000100011111110101001000100011000101100011001011111101011010110100001001101100100100000010101010100110101000011101100010111100110101111100101000011010110001100111011010110011111000100010110111101001101010100100010011000010010110110110000100011011100100000010111000110011101110110100101010101101101111011001110011000101110000001010001000000010001001110011111000101000010000010101000011010101110011000011100101011101100101111001110111111001101011101000100010001111001111000111011001011111111101001001000111011000100000111011001110111100011111110001110100110011100101111011011001010011101100011101011110100110101011001101001101100110100100101111000101000010100100011011111011010001001100100001101100110100011100111001101110110110101000011101110010010101100010010101110111011000100001111100000110000001111110001101101000100101111011100000001001110100000000101101011100011111000010010000001001101010101111000100001011100100001110011101011000001011001001010010111010111111000011111100111101111000100111111000011101011001000101100011111000001001001110111110100100000010000011001110111000000000000100000011011101111000101010010000011000100010100101110000101001011111010101111001101111110011000111101011010101011100110111000001010111111000101000100110111111111100011001001111100010001101000010100001010010001110001000111010000000010011100101001001010000011101010110100000000100111110100100001100100010101101111101111000001010010100000111110001000100111000111101010111010111010111001100101001111101110110100000000111100010000101000110001010010001110001010010100101111100011001010011101010100100000100001100010010111001100001100101100110100101110000011101001110101101111111111100100000110100110101111000001011010100011000010101001001001111111001111111111001010011111011110101110110110001111001110111010111010110100001011001111111101100010100110100111110010111000111100011000111110111101010110001001110011011110101101100101001011001000011101001001000001111001111101010111101010110111011011000000100010000010100110000011011010010010011001011000000001111110100000101000111110000100010011011110111000100100111110000000110111111011101101000111001100111010100011110011001011000101001010110001110110011111100000011010110100011111000010010001010111101111101011110000001110000011010100111101110011000011110001110111111100001011010000000001100100111000111000001000011101001010110010000011010101111110111111000010101101011111111111011001100011111001101011011101101011100001000010111001111011101010101011110110110100101111111101110111001100111100100111111111010110101011101100100100001111101110101010111111111100110001010010000111111000001011000110101111001110011101000000011000100010111101101011111101011000101111011101011110001001100010001101010100110000111100010100110100101110101110111100111001000011100011011001011011110111000110110101111110111111001101011010100001011011001011100110010001011111100110001011100101101101001101100000111100000001111010000000011100010001010010011100011110000010100110010110011101100100000010111100000000011000111100011010011011111111100111001010001000001011101000011000001110010001111001100000010110100001111000000101000101111011011100101001001011001111101101011111010000001100111000000110010100010110100001000111110010111100101111100100011000010100100100011011000111010110110110111001111100001100001110101111100000000011011111110000001010111110101111111101000011110101001000000111011000100000100100011001010010101010010100010000110111000100101000011100010101011101001110001001001011001001111010101101001010110010001000010010110010101011011110111000010101100111000111010110010100010011010011011010111001100000010000000000011101000111110010001110000011111101101001001000101101100011100110010000100000101101011001111000110010010001100011111101101000010010101001100011111001010010011001011100001001111100000110001000111110011001101010101010111101000000010011111011010010111100110011000000110000100110010110000101001101011101011001110000100010011101100100100101100101000100010010001101010100101110101110101100010000011001000001111001000111000110010110101000010111001100010000000010110100110100110101100111111010110010100100010111111011011100110110011100010111010111101010011100011111111001010011110001111100101111111000111011001111110000011001101101110000001100101001011010000010001101011110110000001111111101011111110001010011000110001111010000110000110110100000000111000010100001001011101001010100011100010111011111010101111110111000101101101001101111110101010110010010100001000011001000111100101010110100101110111100111010011111100010100010110000100001111110011111110111100110101101110100011010001001000111001101011111100101111110110000010011111011001101111011000000000100011011101101100110001101011001111110101110000011010110110011000001001000011001100000100000100001111100111010011100000111110101100100101110101011000001100001001110101000100010101111111101011110000001100001011000111001100010011111010011011100111010000010010001100011000101001011110010110001000111111101010010001000110001011000110010111111010110101101000010011011001001000000101010101001101010000111011000101111001101011111001010000110101100011001110110101100111110001000101101111010011010101001000100110000101001011011011000010001101110010000001011100011001110111011010010101010110110111101100111001100010111000000101000100000001000100111001111100010100001000001010100001101010111001100001110010101110110010111100111011111100110101110100010001000111100111100011101100101111111110100100100011101100010000011101100111011110001111111000111010011001110010111101101100101001110110001110101111010011010101100110100110110011010010010111100010100001010010001101111101101000100110010000110110011010001110011100110111011011010100001110111001001010110001001010111011101100010000111110000011000000111111000110110100010010111101110000000100111010000000010110101110001111100001001000000100110101010111100010000101110010000111001110101100000101100100101001011101011111100001111110011110111100010011111100001110101100100010110001111100000100100111011111010010000001000001100111011100000000000010000001101110111100010101001000001100010001010010111000010100101111101010111100110111111001100011110101101010101110011011100000101011111100010100010011011111111110001100100111110001000110100001010000101001000111000100011101000000001001110010100100101000001110101011010000000010011111010010000110010001010110111110111100000101001010000011111000100010011100011110101011101011101011100110010100111110111011010000000011110001000010100011000101001000111000101001010010111110001100101001110101010010000010000110001001011100110000110010110011010010111000001110100111010110111111111110010000011010011010111100000101101010001100001010100100100111111100111111111100101001111101111010111011011000111100111011101011101011010000101100111111110110001010011010011111001011100011110001100011111011110101011000100111001101111010110110010100101100100001110100100100000111100111110101011110101011011101101100000010001000001010011000001101101001001001100101100000000111111010000010100011111000010001001101111011100010010011111000000011011111101110110100011100110011101010001111001100101100010100101011000111011001111110000001101011010001111100001001000101011110111110101111000000111000001101010011110111001100001111000111011111110000101101000000000110010011100011100000100001110100101011001000001101010111111011111100001010110101111111111101100110001111100110101101110110101110000100001011100111101110101010101111011011010010111111110111011100110011110010011111111101011010101110110010010000111110111010101011111111110011000101001000011111100000101100011010111100111001110100000001100010001011110110101111110101100010111101110101111000100110001000110101010011000011110001010011010010111010111011110011100100001110001101100101101111011100011011010111111011111100110101101010000101101100101110011001000101111110011000101110010110110100110110000011110000000111101000000001110001000101001001110001111000001010011001011001110110010000001011110000000001100011110001101001101111111110011100101000100000101110100001100000111001000111100110000001011010000111100000010100010111101101110010100100101100111110110101111101000000110011100000011001010001011010000100011111001011110010111110010001100001010010010001101100011101011011011011100111110000110000111010111110000000001101111111000000101011111010111111110100001111010100100000011101100010000010010001100101001010101001010001000011011100010010100001110001010101110100111000100100101100100111101010110100101011001000100001001011001010101101111011100001010110011100011101011001010001001101001101101011100110000001000000000001110100011111001000111000001111110110100100100010110110001110011001000010000010110101100111100011001001000110001111110110100001001010100110001111100101001001100101110000100111110000011000100011111001100110101010101011110100000001001111101101001011110011001100000011000010011001011000010100110101110101100111000010001001110110010010010110010100010001001000110101010010111010111010110001000001100100000111100100011100011001011010100001011100110001000000001011010011010011010110011111101011001010010001011111101101110011011001110001011101011110101001110001111111100101001111000111110010111111100011101100111111000001100110110111000000110010100101101000001000110101111011000000111111110101111111000101001100011000111101000011000011011010000000011100001010000100101110100101010001110001011101111101010111111011100010110110100110111111010101011001001010000100001100100011110010101011010010111011110011101001111110001010001011000010000111111001111111011110011010110111010001101000100100011100110101111110010111111011000001001111101100110111101100000000010001101110110110011000110101100111111010111000001101011011001100000100100001100110000010000010000111110011101001110000011111010110010010111010101100000110000100111010100010001010111111110101111000000110000101100011100110001001111101001101110011101000001001000110001100010100101111001011000100011111110101001000100011000101100011001011111101011010110100001001101100100100000010101010100110101000011101100010111100110101111100101000011010110001100111011010110011111000100010110111101001101010100100010011000010100101101101100001000110111001000000101110001100111011101101001010101011011011110110011100110001011100000010100010000000100010011100111110001010000100000101010000110101011100110000111001010111011001011110011101111110011010111010001000100011110011110001110110010111111111010010010001110110001000001110110011101111000111111100011101001100111001011110110110010100111011000111010111101001101010110011010011011001101001001011110001010000101001000110111110110100010011001000011011001101000111001110011011101101101010000111011100100101011000100101011101110110001000011111000001100000011111100011011010001001011110111000000010011101000000001011010111000111110000100100000010011010101011110001000010111001000011100111010110000010110010010100101110101111110000111111001111011110001001111110000111010110010001011000111110000010010011101111101001000000100000110011101110000000000001000000110111011110001010100100000110001000101001011100001010010111110101011110011011111100110001111010110101010111001101110000010101111110001010001001101111111111000110010011111000100011010000101000010100100011100010001110100000000100111001010010010100000111010101101000000001001111101001000011001000101011011111011110000010100101000001111100010001001110001111010101110101110101110011001010011111011101101000000001111000100001010001100010100100011100010100101001011111000110010100111010101001000001000011000100101110011000011001011001101001011100000111010011101011011111111111001000001101001101011110000010110101000110000101010010010011111110011111111110010100111110111101011101101100011110011101110101110101101000010110011111111011000101001101001111100101110001111000110001111101111010101100010011100110111101011011001010010110010000111010010010000011110011111010101111010101101110110110000001000100000101001100000110110100100100110010110000000011111101000001010001111100001000100110111101110001001001111100000001101111110111011010001110011001110101000111100110010110001010010101100011101100111111000000110101101000111110000100100010101111011111010111100000011100000110101001111011100110000111100011101111111000010110100000000011001001110001110000010000111010010101100100000110101011111101111110000101011010111111111110110011000111110011010110111011010111000010000101110011110111010101010111101101101001011111111011101110011001111001001111111110101101010111011001001000011111011101010101111111111001100010100100001111110000010110001101011110011100111010000000110001000101111011010111111010110001011110111010111100010011000100011010101001100001111000101001101001011101011101111001110010000111000110110010110111101110001101101011111101111110011010110101000010110110010111001100100010111111001100010111001011011010011011000001111000000011110100000000111000100010100100111000111100000101001100101100111011001000000101111000000000110001111000110100110111111111001110010100010000010111010000110000011100100011110011000000101101000011110000001010001011110110111001010010010110011111011010111110100000011001110000001100101000101101000010001111100101111001011111001000110000101001001000110110001110101101101101110011111000011000011101011111000000000110111111100000010101111101011111111010000111101010010000001110110001000001001000110010100101010100101000100001101110001001010000111000101010111010011100010010010110010011110101011010010101100100010000100101100101010110111101110000101011001110001110101100101000100110100110110101110011000000100000000000111010001111100100011100000111111011010010010001011011000111001100100001000001011010110011110001100100100011000111111011010000100101010011000111110010100100110010111000010011111000001100010001111100110011010101010101111010000000100111110110100101111001100110000001100001001100101100001010011010111010110011100001000100111011001001001011001010001000100100011010101001011101011101011000100000110010000011110010001110001100101101010000101110011000100000000101101001101001101011001111110101100101001000101111110110111001101100111000101110101111010100111000111111110010100111100011111001011111110001110110011111100000110011011011100000011001010010110100000100011010111101100000011111111010111111100010100110001100011110100001100001101101000000001110000101000010010111010010101000111000101110111110101011111101110001011011010011011111101010101100100101000010000110010001111001010101101001011101111001110100111111000101000101100001000011111100111111101111001101011011101000110100010010001110011010111111001011111101100000100111110110011011110110000000001000110111011011001100011010110011111101011100000110101101100110000010010000110011000001000001000011111001110100111000001111101011001001011101010110000011000010011101010001000101011111111010111100000011000010110001110011000100111110100110111001110100000100100011000110001010010111100101100010001111111010100100010001100010110001100101111110101101011010000100110110010010000001010101010011010100001110110001011110011010111110010100001101011000110011101101011001111100010001011011110100110101010010001001100001</code>

tak nějak nevim co s tím ...

Nahlásit jako SPAM
IP: 78.108.147.–
Petr
~ Anonymní uživatel
746 příspěvků
11. 11. 2014   #2
-
0
-

<code></code>

neuvažujte to jsem přidal já a nevěděl jsem že to toto forum neumí ...

Nahlásit jako SPAM
IP: 78.108.147.–
lukas.balaz0
Super člen
11. 11. 2014   #3
-
0
-

#2 Petr
Ale stále nechápem čo si myslel. Čo znamená to <skipping 136154 B>

Nahlásit jako SPAM
IP: 80.242.41.–
KIIV
~ Moderátor
+43
God of flame
11. 11. 2014   #4
-
0
-

zavzpominej na zakladku, kdy se ucilo scitat pod sebou s prenosama do vyssich radu.. stejne to funguje pro binarku...

Nahlásit jako SPAM
IP: 62.168.56.–
Program vždy dělá to co naprogramujete, ne to co chcete...
11. 11. 2014   #5
-
0
-

A nebo hledej, myslím, že už to tady bylo

Jinak je důležité vědět, že ve dvojkové soustavě 1 + 1 = 10

hu

Nahlásit jako SPAM
IP: 2001:67c:1222:800:ede4:d2...–
Petr
~ Anonymní uživatel
746 příspěvků
11. 11. 2014   #6
-
0
-

úplně jste nepochopili můj problém ... 

těch zadaných vstupů je celá řada a na to moje řešení stačí ... řeším to pomoc porovnávání 2 stringů respketivně jako sčítání binárních čísel pod sebou ... ale ten vstup co jsem jsem postnul můj program nezvládne ... a problém je u načtení ... ten řetězec je prostě tak gigantický, že mi ho string nepojme ... 

Nahlásit jako SPAM
IP: 78.108.147.–
Petr
~ Anonymní uživatel
746 příspěvků
11. 11. 2014   #7
-
0
-

pokud je někde tady možnost klidně uploudnu svůj zdoják ...

Nahlásit jako SPAM
IP: 78.108.147.–
Petr
~ Anonymní uživatel
746 příspěvků
11. 11. 2014   #8
-
0
-

PS: <skipping 136154 B> toto nechápem ani já ale tak to má zadané ten učitel ...

Nahlásit jako SPAM
IP: 78.108.147.–
KIIV
~ Moderátor
+43
God of flame
11. 11. 2014   #9
-
0
-

#6 Petr
to mas tak malou ramku? nebo stringem myslis neco jineho nez std::string?

Nahlásit jako SPAM
IP: 94.113.95.–
Program vždy dělá to co naprogramujete, ne to co chcete...
Petr
~ Anonymní uživatel
746 příspěvků
11. 11. 2014   #10
-
0
-

ani jedno ... při pokusu o načtení pomocí 

string test;

cin >> test;

0010110110110000100011011100100000010111000110011101110110100101010101101101111011001110011000101110000001010001000000010001001110011111000101000010000010101000011010101110011000011100101011101100101111001110111111001101011101000100010001111001111000111011001011111111101001001000111011000100000111011001110111100011111110001110100110011100101111011011001010011101100011101011110100110101011001101001101100110100100101111000101000010100100011011111011010001001100100001101100110100011100111001101110110110101000011101110010010101100010010101110111011000100001111100000110000001111110001101101000100101111011100000001001110100000000101101011100011111000010010000001001101010101111000100001011100100001110011101011000001011001001010010111010111111000011111100111101111000100111111000011101011001000101100011111000001001001110111110100100000010000011001110111000000000000100000011011101111000101010010000011000100010100101110000101001011111010101111001101111110011000111101011010101011100110111000001010111111000101000100110111111111100011001001111100010001101000010100001010010001110001000111010000000010011100101001001010000011101010110100000000100111110100100001100100010101101111101111000001010010100000111110001000100111000111101010111010111010111001100101001111101110110100000000111100010000101000110001010010001110001010010100101111100011001010011101010100100000100001100010010111001100001100101100110100101110000011101001110101101111111111100100000110100110101111000001011010100011000010101001001001111111001111111111001010011111011110101110110110001111001110111010111010110100001011001111111101100010100110100111110010111000111100011000111110111101010110001001110011011110101101100101001011001000011101001001000001111001111101010111101010110111011011000000100010000010100110000011011010010010011001011000000001111110100000101000111110000100010011011110111000100100111110000000110111111011101101000111001100111010100011110011001011000101001010110001110110011111100000011010110100011111000010010001010111101111101011110000001110000011010100111101110011000011110001110111111100001011010000000001100100111000111000001000011101001010110010000011010101111110111111000010101101011111111111011001100011111001101011011101101011100001000010111001111011101010101011110110110100101111111101110111001100111100100111111111010110101011101100100100001111101110101010111111111100110001010010000111111000001011000110101111001110011101000000011000100010111101101011111101011000101111011101011110001001100010001101010100110000111100010100110100101110101110111100111001000011100011011001011011110111000110110101111110111111001101011010100001011011001011100110010001011111100110001011100101101101001101100000111100000001111010000000011100010001010010011100011110000010100110010110011101100100000010111100000000011000111100011010011011111111100111001010001000001011101000011000001110010001111001100000010110100001111000000101000101111011011100101001001011001111101101011111010000001100111000000110010100010110100001000111110010111100101111100100011000010100100100011011000111010110110110111001111100001100001110101111100000000011011111110000001010111110101111111101000011110101001000000111011000100000100100011001010010101010010100010000110111000100101000011100010101011101001110001001001011001001111010101101001010110010001000010010110010101011011110111000010101100111000111010110010100010011010011011010111001100000010000000000011101000111110010001110000011111101101001001000101101100011100110010000100000101101011001111000110010010001100011111101101000010010101001100011111001010010011001011100001001111100000110001000111110011001101010101010111101000000010011111011010010111100110011000000110000100110010110000101001101011101011001110000100010011101100100100101100101000100010010001101010100101110101110101100010000011001000001111001000111000110010110101000010111001100010000000010110100110100110101100111111010110010100100010111111011011100110110011100010111010111101010011100011111111001010011110001111100101111111000111011001111110000011001101101110000001100101001011010000010001101011110110000001111111101011111110001010011000110001111010000110000110110100000000111000010100001001011101001010100011100010111011111010101111110111000101101101001101111110101010110010010100001000011001000111100101010110100101110111100111010011111100010100010110000100001111110011111110111100110101101110100011010001001000111001101011111100101111110110000010011111011001101111011000000000100011011101101100110001101011001111110101110000011010110110011000001001000011001100000100000100001111100111010011100000111110101100100101110101011000001100001001110101000100010101111111101011110000001100001011000111001100010011111010011011100111010000010010001100011000101001011110010110001000111111101010010001000110001011000110010111111010110101101000010011011001001000000101010101001101010000111011000101111001101011111001010000110101100011001110110101100111110001000101101111010011010101001000100110000101001011011011000010001101110010000001011100011001110111011010010101010110110111101100111001100010111000000101000100000001000100111001111100010100001000001010100001101010111001100001110010101110110010111100111011111100110101110100010001000111100111100011101100101111111110100100100011101100010000011101100111011110001111111000111010011001110010111101101100101001110110001110101111010011010101100110100110110011010010010111100010100001010010001101111101101000100110010000110110011010001110011100110111011011010100001110111001001010110001001010111011101100010000111110000011000000111111000110110100010010111101110000000100111010000000010110101110001111100001001000000100110101010111100010000101110010000111001110101100000101100100101001011101011111100001111110011110111100010011111100001110101100100010110001111100000100100111011111010010000001000001100111011100000000000010000001101110111100010101001000001100010001010010111000010100101111101010111100110111111001100011110101101010101110011011100000101011111100010100010011011111111110001100100111110001000110100001010000101001000111000100011101000000001001110010100100101000001110101011010000000010011111010010000110010001010110111110111100000101001010000011111000100010011100011110101011101011101011100110010100111110111011010000000011110001000010100011000101001000111000101001010010111110001100101001110101010010000010000110001001011100110000110010110011010010111000001110100111010110111111111110010000011010011010111100000101101010001100001010100100100111111100111111111100101001111101111010111011011000111100111011101011101011010000101100111111110110001010011010011111001011100011110001100011111011110101011000100111001101111010110110010100101100100001110100100100000111100111110101011110101011011101101100000010001000001010011000001101101001001001100101100000000111111010000010100011111000010001001101111011100010010011111000000011011111101110110100011100110011101010001111001100101100010100101011000111011001111110000001101011010001111100001001000101011110111110101111000000111000001101010011110111001100001111000111011111110000101101000000000110010011100011100000100001110100101011001000001101010111111011111100001010110101111111111101100110001111100110101101110110101110000100001011100111101110101010101111011011010010111111110111011100110011110010011111111101011010101110110010010000111110111010101011111111110011000101001000011111100000101100011010111100111001110100000001100010001011110110101111110101100010111101110101111000100110001000110101010011000011110001010011010010111010111011110011100100001110001101100101101111011100011011010111111011111100110101101010000101101100101110011001000101111110011000101110010110110100110110000011110000000111101000000001110001000101001001110001111000001010011001011001110110010000001011110000000001100011110001101001101111111110011100101000100000101110100001100000111001000111100110000001011010000111100000010100010111101101110010100100101100111110110101111101000000110011100000011001010001011010000100011111001011110010111110010001100001010010010001101100011101011011011011100111110000110000111010111110000000001101111111000000101011111010111111110100001111010100100000011101100010000010010001100101001010101001010001000011011100010010100001110001010101110100111000100100101100100111101010110100101011001000100001001011001010101101111011100001010110011100011101011001010001001101001101101011100110000001000000000001110100011111001000111000001111110110100100100010110110001110011001000010000010110101100111100011001001000110001111110110100001001010100110001111100101001001100101110000100111110000011000100011111001100110101010101011110100000001001111101101001011110011001100000011000010011001011000010100110101110101100111000010001001110110010010010110010100010001001000110101010010111010111010110001000001100100000111100100011100011001011010100001011100110001000000001011010011010011010110011111101011001010010001011111101101110011011001110001011101011110101001110001111111100101001111000111110010111111100011101100111111000001100110110111000000110010100101101000001000110101111011000000111111110101111111000101001100011000111101000011000011011010000000011100001010000100101110100101010001110001011101111101010111111011100010110110100110111111010101011001001010000100001100100011110010101011010010111011110011101001111110001010001011000010000111111001111111011110011010110111010001101000100100011100110101111110010111111011000001001111101100110111101100000000010001101110110110011000110101100111111010111000001101011011001100000100100001100110000010000010000111110011101001110000011111010110010010111010101100000110000100111010100010001010111111110101111000000110000101100011100110001001111101001101110011101000001001000110001100010100101111001011000100011111110101001000100011000101100011001011111101011010110100001001101100100100000010101010100110101000011101100010111100110101111100101000011010110001100111011010110011111000100010110111101001101010100100010011000010010110110110000100011011100100000010111000110011101110110100101010101101101111011001110011000101110000001010001000000010001001110011111000101000010000010101000011010101110011000011100101011101100101111001110111111001101011101000100010001111001111000111011001011111111101001001000111011000100000111011001110111100011111110001110100110011100101111011011001010011101100011101011110100110101011001101001101100110100100101111000101000010100100011011111011010001001100100001101100110100011100111001101110110110101000011101110010010101100010010101110111011000100001111100000110000001111110001101101000100101111011100000001001110100000000101101011100011111000010010000001001101010101111000100001011100100001110011101011000001011001001010010111010111111000011111100111101111000100111111000011101011001000101100011111000001001001110111110100100000010000011001110111000000000000100000011011101111000101010010000011000100010100101110000101001011111010101111001101111110011000111101011010101011100110111000001010111111000101000100110111111111100011001001111100010001101000010100001010010001110001000111010000000010011100101001001010000011101010110100000000100111110100100001100100010101101111101111000001010010100000111110001000100111000111101010111010111010111001100101001111101110110100000000111100010000101000110001010010001110001010010100101111100011001010011101010100100000100001100010010111001100001100101100110100101110000011101001110101101111111111100100000110100110101111000001011010100011000010101001001001111111001111111111001010011111011110101110110110001111001110111010111010110100001011001111111101100010100110100111110010111000111100011000111110111101010110001001110011011110101101100101001011001000011101001001000001111001111101010111101010110111011011000000100010000010100110000011011010010010011001011000000001111110100000101000111110000100010011011110111000100100111110000000110111111011101101000111001100111010100011110011001011000101001010110001110110011111100000011010110100011111000010010001010111101111101011110000001110000011010100111101110011000011110001110111111100001011010000000001100100111000111000001000011101001010110010000011010101111110111111000010101101011111111111011001100011111001101011011101101011100001000010111001111011101010101011110110110100101111111101110111001100111100100111111111010110101011101100100100001111101110101010111111111100110001010010000111111000001011000110101111001110011101000000011000100010111101101011111101011000101111011101011110001001100010001101010100110000111100010100110100101110101110111100111001000011100011011001011011110111000110110101111110111111001101011010100001011011001011100110010001011111100110001011100101101101001101100000111100000001111010000000011100010001010010011100011110000010100110010110011101100100000010111100000000011000111100011010011011111111100111001010001000001011101000011000001110010001111001100000010110100001111000000101000101111011011100101001001011001111101101011111010000001100111000000110010100010110100001000111110010111100101111100100011000010100100100011011000111010110110110111001111100001100001110101111100000000011011111110000001010111110101111111101000011110101001000000111011000100000100100011001010010101010010100010000110111000100101000011100010101011101001110001001001011001001111010101101001010110010001000010010110010101011011110111000010101100111000111010110010100010011010011011010111001100000010000000000011101000111110010001110000011111101101001001000101101100011100110010000100000101101011001111000110010010001100011111101101000010010101001100011111001010010011001011100001001111100000110001000111110011001101010101010111101000000010011111011010010111100110011000000110000100110010110000101001101011101011001110000100010011101100100100101100101000100010010001101010100101110101110101100010000011001000001111001000111000110010110101000010111001100010000000010110100110100110101100111111010110010100100010111111011011100110110011100010111010111101010011100011111111001010011110001111100101111111000111011001111110000011001101101110000001100101001011010000010001101011110110000001111111101011111110001010011000110001111010000110000110110100000000111000010100001001011101001010100011100010111011111010101111110111000101101101001101111110101010110010010100001000011001000111100101010110100101110111100111010011111100010100010110000100001111110011111110111100110101101110100011010001001000111001101011111100101111110110000010011111011001101111011000000000100011011101101100110001101011001111110101110000011010110110011000001001000011001100000100000100001111100111010011100000111110101100100101110101011000001100001001110101000100010101111111101011110000001100001011000111001100010011111010011011100111010000010010001100011000101001011110010110001000111111101010010001000110001011000110010111111010110101101000010011011001001000000101010101001101010000111011000101111001101011111001010000110101100011001110110101100111110001000101101111010011010101001000100110000101001011011011000010001101110010000001011100011001110111011010010101010110110111101100111001100010111000000101000100000001000100111001111100010100001000001010100001101010111001100001110010101110110010111100111011111100110101110100010001000111100111100011101100101111111110100100100011101100010000011101100111011110001111111000111010011001110010111101101100101001110110001110101111010011010101100110100110110011010010010111100010100001010010001101111101101000100110010000110110011010001110011100110111011011010100001110111001001010110001001010111011101100010000111110000011000000111111000110110100010010111101110000000100111010000000010110101110001111100001001000000100110101010111100010000101110010000111001110101100000101100100101001011101011111100001111110011110111100010011111100001110101100100010110001111100000100100111011111010010000001000001100111011100000000000010000001101110111100010101001000001100010001010010111000010100101111101010111100110111111001100011110101101010101110011011100000101011111100010100010011011111111110001100100111110001000110100001010000101001000111000100011101000000001001110010100100101000001110101011010000000010011111010010000110010001010110111110111100000101001010000011111000100010011100011110101011101011101011100110010100111110111011010000000011110001000010100011000101001000111000101001010010111110001100101001110101010010000010000110001001011100110000110010110011010010111000001110100111010110111111111110010000011010011010111100000101101 

se mi místo načtení objeví toto, respektivně program se sám ukončí

Process returned 0 (0x0)   execution time : 17.155 s

Press any key to continue.

to znamená, že potřebuji vyřešit nějaký jiný způsob načítání ...

Nahlásit jako SPAM
IP: 78.108.147.–
KIIV
~ Moderátor
+43
God of flame
11. 11. 2014   #11
-
0
-

   

#include <iostream>
#include <string>
using namespace std;


int main() {
  string test;
  cin >> test;
  cout << test.size() << endl;
}
kiiv@kiiv-VirtualBox:/tmp$ g++ test.cpp && time ./a.out <data.txt
16384

real    0m0.002s
user    0m0.000s
sys     0m0.000s

nevidim duvod, proc by to melo trvat 17s

Nahlásit jako SPAM
IP: 94.113.95.–
Program vždy dělá to co naprogramujete, ne to co chcete...
Zjistit počet nových příspěvků

Přidej příspěvek

Toto téma je starší jak čtvrt roku – přidej svůj příspěvek jen tehdy, máš-li k tématu opravdu co říct!

Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku

×Vložení zdrojáku

×Vložení obrázku

Vložit URL obrázku Vybrat obrázek na disku
Vlož URL adresu obrázku:
Klikni a vyber obrázek z počítače:

×Vložení videa

Aktuálně jsou podporována videa ze serverů YouTube, Vimeo a Dailymotion.
×
 
Podporujeme Gravatara.
Zadej URL adresu Avatara (40 x 40 px) nebo emailovou adresu pro použití Gravatara.
Email nikam neukládáme, po získání Gravatara je zahozen.
-
Pravidla pro psaní příspěvků, používej diakritiku. ENTER pro nový odstavec, SHIFT + ENTER pro nový řádek.
Sledovat nové příspěvky (pouze pro přihlášené)
Sleduj vlákno a v případě přidání nového příspěvku o tom budeš vědět mezi prvními.
Reaguješ na příspěvek:

Uživatelé prohlížející si toto vlákno

Uživatelé on-line: 0 registrovaných, 126 hostů

Podobná vlákna

Součet binárních čísel — založil Divisor

Scitani rady cisel — založil Lusi

Moderátoři diskuze

 

Hostujeme u Českého hostingu       ISSN 1801-1586       ⇡ Nahoru Webtea.cz logo © 20032024 Programujte.com
Zasadilo a pěstuje Webtea.cz, šéfredaktor Lukáš Churý