Professional Documents
Culture Documents
Using Namespace Int Int Int Int For For If Return: #Include N A
Using Namespace Int Int Int Int For For If Return: #Include N A
Using Namespace Int Int Int Int For For If Return: #Include N A
#include <iostream>
using namespace std;
int cdif(int n, int a[])
{
int i, j;
for (i = 0; i < n; i++)
{
for (j = i + 1; j < n; j++)
{
if (a[j] == a[i])
return 0;
}
}
return 1;
}
int main()
{
int i, n, a[10001];
for (i = 0; i < n; i++)
cin >> a[i];
for (i = 0; i < n; i++)
{
if (a[i] < 500 && a[i]>1000 && cdif() == 1)
cout << a[i];
}
}
2. #include <iostream>
using namespace std;
int b[1001];
int inv(int n, int a[])
{
int i, j;
for (i = 0; i < n; i++)
{
b[i] = 0;
while (a[i])
{
j = a[i] % 10;
b[j] = b[j] * 10 + a[i];
n = n / 10;
}
return b[i];
}
int main()
{
int i, n, a[10001];
for (i = 0; i < n; i++)
cin >> a[i];
for (i = 0; i < n; i++)
{
cout << inv(b[i]);
}
}
3. #include <iostream>
using namespace std;
int b[1001];
int ncifpatrate(int n)
{
int i, c,patrat;
if (n == 2 && n == 3 && n == 7 && n == 8)
return 0;
else
{
for (i = 1; i <= 1000; i++)
{
patrat = i * i;
if (patrat % 10 == n)
return patrat;
}
}
}
5. #include <iostream>
using namespace std;
int b[1001];
int par(int cif)
{
if (cif == 1 && cif == 3 && cif == 5 && cif == 7 && cif == 9)
return 0;
else return 1;