8 条题解
- 1
信息
- ID
- 156
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 1
- 标签
- 递交数
- 120
- 已通过
- 95
- 上传者
自行领取您的题解🚀️
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n , a[200];
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a[i];
if (a[i] * a[i] % 7 != 1) cout << a[i] << " ";
}
return 0;
}
AC,放心食用
我又来啦!
#include <bits/stdc++.h>
using namespace std;
int x,n;
int Judge(int y)
{
if (y * y % 7 == 1)
return true;
else
return false;
}
int main()
{
cin >> n;
for (int i = 1;i <= n;i ++)
{
cin >> x;
if (!Judge(x))
cout << x << " ";
}
return 0;
}
消灭异形,~消灭张三~!🚀️
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a[205];
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a[i];//输入数组
if(a[i]*a[i]%7!=1) cout<<a[i]<<" ";
//输出基因序号的平方除以7的余数都是1的数
}
return 0;
}//没有感染,放心食用
~简单~
#include <bits/stdc++.h>
using namespace std;
int n, a[205];
int main()
{
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
}
for (int i = 1; i <= n; i++)
{
if (a[i] * a[i] % 7 != 1)
{
cout << a[i] << " ";
}
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a[205];
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
if(a[i]*a[i]%7!=1)
{
cout<<a[i]<<"\n";
}
}
}