//ShowMe.cc //ECNA 2012 - Show Me the Money #include #include using namespace std; const bool DEBUG = false; #define IFDB if (DEBUG) #define FOR(i,n) for(int i=0; i>n; while (n>0){ init(); //get rates FOR(i,n){ cin>>r1>>n1>>eq>>r2>>n2; i1 = FindName(n1); i2 = FindName(n2); InsertRates(i1,r1,i2,r2); } //IFDB PrintTable(); FillInTable(); IFDB PrintTable(); //get inquiry cin>>amt>>den; i1 = FindName(den); //find best exchange bestratio = 1000000.0; bestnumber = 0; bestdenom = -1; //find best j for amt of i1 FOR(j,size) if(j != i1){ if(rates[i1][j]>0.0){ m = ceil(amt * rates[j][i1] - 0.0000001); IFDB cout<>n; } return 0; }