-->
当前位置:首页 > 题库 > 正文内容

FILL_IN_THE_BLANK_FOR_PROGRAMMING:Find a specific positive integer

Luz3年前 (2021-05-10)题库265
The sum of all digits in the range of 100 ~ 199 is a multiple of odd number 3. For example: the sum of 111 digits 1 + 1 + 1 = 3 is odd, and 111 itself is a multiple of 3, so 111 meets the condition.
```
#include
int main()
{
int i, sum, x;
for(i=100; i<=199; i++)
{
sum = 0;
if( i%3 != 0 )
@@[continue;]( 2)
x = i;
while( x != 0 )
{
sum += x%10;
@@[x /=10;]( 2)
}
if( @@[sum%2==1](2) )
printf( "%d ", i );
}
return 0;
}
```






answer:The first blank: continue;
The second null: X / = 10;
The third null: sum% 2 = = 1

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。