Simple recursive topic, according to the recursive function recursive process simulation can look at the subject. #include giovanni allevi secret love <iostream> giovanni allevi secret love using namespace std; const int size = 21; int map [size] [size] [size]; void makeMap () {int a, b, c; for (a = 0; a <size; a ++ ) for (b = 0; b <size; b ++) for (c = 0; c <size; giovanni allevi secret love c ++) {if (a <= 0 || b <= 0 || c <= 0) map [a] [ b] [c] = 1; else if (a <b && b <c) map [a] [b] [c] = map [a] [b] [c-1] + map [a] [b- 1] [c-1] - map [a] [b-1] [c]; else map [a] [b] [c] = map [a-1] [b] [c] + map [a- 1] [b-1] [c] + map [a-1] [b] [c-1] - map [a-1] [b-1] [c-1];}} int main () { int a, b, c, ans; makeMap (); while (scanf ("% d% d% d", & a, & b, & c) == 3) {if (a == -1 && b == -1 && c == -1) break; if (a <0 || b <0 || c <0) ans = 1; else if (a> 20 || b> 20 || c> 20) ans = map [ 20] [20] [20]; else ans = map [a] [b] [c]; printf ("w (% d,% d,% d) =% d \ n", a, b, c, ans);} return 0;}
All topics Hadoop AWS mobile games Java Android iOS Swift intelligent hardware Docker OpenStack VPN Spark ERP IE10 Eclipse CRM JavaScript database Ubuntu NFC WAP jQuery BI HTML5 Spring Apache giovanni allevi secret love .NET API HTML SDK IIS Fedora XML LBS Unity Splashtop UML components Windows Mobile Rails QEMU KDE Cassandra CloudStack FTC coremail OPhone CouchBase cloud iOS6 Rackspace Web App SpringSide Maemo Compuware large data aptech Perl Tornado Ruby Hibernate ThinkPHP HBase Pure Solr Angular Cloud Foundry Redis Scala Django Bootstrap
March 2013 (1) February 2013 (1) October 2012 (1) September 2012 (4) August 2012 (1) July 2012 (25) June 2012 (1) 2012 In May (1) April 2012 (8) March 2012 (12) February 2012 (12) December 2011 (14) November 2011 (8) October 2011 (19) 2011 September (27) August 2011 (12) July 2011 (12)
Read the contents of the text box Ranking java monitor changes (2208) nLogn LCS algorithm summary (1137) poj1036 Gangsters (1110) poj2451 half-plane cross (1038) poj1755 giovanni allevi secret love half-plane cross Inequality Group (1036) half-plane cross (940) poj3468 tree array (interval update) (868) poj2135 (859) poj1390 box eliminate dp (857) to set their computers to a wireless router (win7) (855)
NiaNiaJR: Good thank poj1036 Gangsters
No comments:
Post a Comment