0分,求大佬解答(求求了)
查看原帖
0分,求大佬解答(求求了)
996200
President_Zhao楼主2023/7/9 18:09
#include<bits/stdc++.h>
using namespace std;
int yyy[100];
int lll[100];
int main()
{
    int a,total=0,h=0;
    cin>>a;
    for(int y=0;y<a;y++)
    {
    	cin>>yyy[y];
	}
	for(int o=0;o<a;o++)
	{
		for(int p=o+1;p<a;p++)
		{
			for(int u=0;u<a;u++)
			{
				if(yyy[o]+yyy[p]==yyy[u])
				{
					lll[h]=yyy[u];
					h++;
					total++;
					break;
				}
			}
		}
	}
	for(int r=0;r<a;r++)
	{
		for(int e=r+1;e<a;e++)
		{
			if(lll[r]==lll[e])
			{
				total--;
			}
		}
	}
	cout<<total;
}
```
2023/7/9 18:09
加载中...