include stdio include stdlib include math int main int argc char argv

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char *argv[])
{ int x, n, prov, ost, i;
n=-1;
i=0;
x=0;
prov=0;
ost=0;
while (n<1)
{
printf(" vvedite celoe N bolshe 0. N= ");
scanf("%d", &n );
}
printf(" chislo N v proverke na '7' ychastia ne prinimaet ");
for (i=0; i<n; i++)
{
printf(" vvedite celoe chislo ");
scanf("%d", &x );
if (prov==0 && x!=0)
{
if (x%7==0)
prov++;
else
{
x=abs(x);
while (x>1 && prov==0)
{
ost=x%10;
x-=ost;
x/=10;
if (ost%7==0)
prov++;
}
}
}
}
if (prov==1)
printf(" da");
else
printf(" nety");
system("PAUSE");
return 0;
}