+0  
 
0
347
1
avatar

The positive integer n has the following properties:

 

* n is even

* when n is divided by 5, the remainder is 1

* n is divisible by 7

* n < 1000

* the sum of the digits of n is 23.

 

Find n.

 Jun 28, 2020
 #1
avatar
0

a=0;b=0;c=0;p=0; cycle:d=a*100+b*10+c;if(d%2==0 and d%5==1 and d%7==0 and d<1000 and(a+b+c==23), goto loop, goto next); loop:printd," ",;p=p+1; next:c++;if(c<10, goto cycle, 0);c=0;b++;if(b<10, goto cycle, 0);c=0;b=0;a++;if(a<10, goto cycle,0);print"Total = ",p

 

OUTPUT = n =896

 Jun 28, 2020

5 Online Users

avatar
avatar
avatar