HDU 1259(水题)

来源:互联网 发布:网络本科文凭有用 编辑:程序博客网 时间:2024/06/04 00:29
#include<iostream>using namespace std;int main(){    int N;    cin >> N;    while (N--)    {        int map[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };        int n;        cin >> n;        while (n--)        {            int i, j, temp;            cin >> i >> j;            temp = map[i];            map[i] = map[j];            map[j] = temp;        }        for (int k = 1; k < 8;k++)            if (map[k] == 2) cout << k << endl;    }    return 0;}

0 0
原创粉丝点击