+0  
 
+1
35
2
avatar+426 

How many 3-digit numbers have the property that the units digit is at least twice the tens digit?

 Sep 30, 2020
 #1
avatar
0

a=1;b=0;c=0;p=0; cycle:d=a*100+b*10+c;if(c - b >=2, 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 = 324 such numbers.

 Sep 30, 2020
 #2
avatar+426 
+1

I don't understand your python?

 

Thanks

 Sep 30, 2020

16 Online Users

avatar
avatar