### 2012年哈爾濱工業大學計算機研究生機試真題

`#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#include <set>using namespace std;const int INF = 1000000000;const int maxn = 10001; char a[maxn] , b[maxn];void MyStrcat(char dstStr[] , char srcStr[]){    char c[maxn];    int cnt = 0;    for(int i = 0 ; dstStr[i] ; i ++)        c[cnt++] = dstStr[i];    for(int i = 0 ; srcStr[i] ; i ++)        c[cnt++] = srcStr[i];    c[cnt++] = '\0';    for(int i = 0 ; c[i] ; i ++)        printf("%c" , c[i]);    cout << endl;} int main(){    #ifdef DoubleQ    freopen("in.txt" , "r" , stdin);    #endif // DoubleQ    while(cin >> a >> b)    {         MyStrcat(a , b);    }}`

`#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#include <set>using namespace std;const int INF = 1000000000;const int maxn = 10001; int main(){    long long sum = 1;    long long k = 1;    for(int i = 2 ; i <= 30 ; i ++)    {        k = k * 2;        sum += k;    }    cout << "300 " << sum << endl;}`

`#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#include <set>using namespace std;const int INF = 1000000000;const int maxn = 10001; long long a[4][4] , b[4][4];long long c[4][4];int main(){    #ifdef DoubleQ    freopen("in.txt" , "r" , stdin);    #endif // DoubleQ         while(cin >> a[0][0])    {        cin >> a[0][1] >> a[0][2] >> a[1][0] >> a[1][1] >> a[1][2];        for(int i = 0 ; i < 3 ; i ++)        {            for(int j = 0 ; j < 2 ; j ++)            {                cin >> b[i][j];            }        }        for(int i = 0 ; i < 2 ; i ++)        {            for(int j = 0 ; j < 2 ; j ++)            {                long long sum = 0;                for(int k = 0 ; k < 3 ; k ++)                {                     sum += a[i][k] * b[k][j];                }                c[i][j] = sum;            }        }        for(int i = 0 ; i < 2 ; i ++)        {            for(int j = 0 ; j < 2 ; j ++)            {                cout << c[i][j] << " ";            }            cout << endl;        }    }} `