www.www.zaachi.com »  Blog/Algoritmy  »  Logické cvičení »  Komentáře

Komentáře ke článku: Logické cvičení

Přidat komentář

Jméno:
Email:
WWW:
Text zprávy:
Jméno českého presidenta

Komentáře (9)

# Jan Kostelnik   (16.09.2009 19:16:08) Reagovat
Tady prikladam reseni v Jave :-]

String strNum = "1";
String testing;
String testing_next;
String result;
int count;
System.out.println(strNum);
for (int i = 0; i < 5; i++) {
result = "";
count = 1;
testing = strNum.substring(0, 1);
for (int j = 1; j < strNum.length(); j++) {
testing_next = strNum.substring(j, j + 1);
if (testing.equals(testing_next)) {
count++;
} else {
result += count + testing;
testing = new String(testing_next);
count = 1;
}
}
if (count > 1) {
result += count + testing;
} else {
result += String.valueOf(1) + testing;
}
strNum = new String(result);
System.out.println(strNum);
}

 

#   (01.09.2008 13:08:48) Reagovat
Tak tenhle humus znam se stredni skoly, takze vyreseno za par sekund (stacilo si jen vzpomenout). Popravde, nepredpokladal jsem, ze na to jeste nekdy natrefim :)

 

# jaks   (08.08.2008 12:08:24) Reagovat
a s čím to alespon souvisí?

 

# jaks   (08.08.2008 11:43:49) Reagovat
Zajímalo by mě jestli to jde vubec vyresit?

 

# marek   (08.08.2008 11:48:03) Reagovat
No vsak tam mas hotovy program, ktery to resi.

 

# jaks   (08.08.2008 12:07:23) Reagovat
muzete mi nekdo prozradit princip te hadanky?

 

# jaks   (08.08.2008 12:06:24) Reagovat
muzete mi nekdo prozradit princip te hadanky?

 

# jaks   (08.08.2008 11:57:25) Reagovat
ok

 

# marek   (08.08.2008 12:07:34) Reagovat
Na to musis prijit sam => Logicke cviceni.

 
TOPLIST.cz
rss coments img img img