# Ifndef link_table_h # define link_table_h # include "stdafx. H "# include <iostream> # include <cstdlib> # include <ctime> # include <string> using namespace STD; struct tnode {int row, Col, Val; struct tnode * right, * down;}; void install (tnode * head); // void rand_num (int * & head); void wait (INT wait_time ); void insert (tnode * head); void output (tnode * head); // void search (tnode * head); // void destory (tnode * head ); // void add (tnod E * head); // void sub (tnode * head); // void mult (tnode * head); // void plus (tnode * head ); // void destory (tnode * & head); # endif // implementation # include "stdafx. H "# include" link_table.h "Void install (tnode * head) {cout <" Enter the head linked list of the cross linked list <list> and <Row Table>: "; int C, r; CIN> C> r; If (R! = 0 & C! = 0) {If (r> = 65535 | C> = 65535) {cout <"the maximum number that can be expressed by an integer is exceeded" <Endl; wait (5 ); exit (exit_failure);} else {tnode * rhead = new tnode [R]; tnode * chead = new tnode [c]; for (INT I = 0; I <R; ++ I) {rhead [I]. down = rhead [I]. right = NULL; rhead [I]. val = 0; rhead [I]. col = 0; rhead [I]. row = I;} // ffor (Int J = 0; j <C; ++ J) {chead [J]. right = chead [J]. down = NULL; chead [J]. val = 0; chead [J]. row = 0; chead [J]. col = J ;}// forhead-> ROW = r; head-> Col = C; head-> val = 0; // count none_zero Number head-> down = & rhead [0]; head-> right = & chead [0];} // else} // ifreturn;} void insert (tnode * head) {tnode * Pr = head-> down; tnode * Pc = head-> right; int R, C, Val; cout <"input triple rows, columns, and a non-zero value "<Endl; For (CIN> r> C> val; Val! = 0; CIN> r> C> Val) {If (r> head-> row | C> head-> Col | val = 0) {If (r> head-> row) {cout <"the row value cannot be greater than"
Http://topic.csdn.net/u/20110602/23/0e84907d-f8f9-41ec-ae68-6a76269d5f71.html