HDU 4593 Robot

来源:互联网 发布:假身份证骗网络贷款 编辑:程序博客网 时间:2024/06/06 18:25

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4593

题目很长,但有用的就那两行,很水的有一道题目;

代码如下:

#include<bits/stdc++.h>using namespace std;int main(){    int n; int a[1001];    while(scanf("%d",&n)!=EOF)    {        memset(a,0,sizeof(a));        int x;        for(int i=0; i<n+1; i++)        {            scanf("%d",&x);            a[x]++;        }        for(int i=0; i<=n; i++)        {            if(a[i]==2)                printf("%d\n",i);        }    }}

0 0