2 x t + 35 x t 2t + 35t 37t
2d+2h+2t+g+f+2r+w+x
3tx + 6t + 3hx +6h = 3(tx + 2t +hx +2h) = 3[t(x + 2) + h(x + 2)] = 3(x + 2)(t + h)
void swap(int &x, int &y) { x ^= y ^= x; } - or - void swap(int &x, int &y) { int t = x; x = y; y = t; }
(t+h)(x+2)
(x + 2)(h + t)
This equation has no meaning. 47 cubed is 103,823, but the rest of the equation is worthless without a value for x and t. At present, X and T do not have values, so you can not evaluate this expression.
x2 is the same as x times x. In this case x = t+2 so we can say (t+2)2 is (t+2)(t+2) or t2+4t+4
Use the following template function: template<class T> T& max(T& x, T& y){return(y<x?x:y;}
4t - 2p
#include<iostream> template<typename T> void exch(T& a, T& b) { T temp = a; a = b; b = temp; } int main() { int x=4, y=2; exch(x,y); }
4x-4y-ty+xt = 4x+tx-4y-ty = x(4+t) - y(4+t) = (x-y)*(4+t)