當前位置:編程學習大全網 - 編程軟體 - 請用能被5和7整除的三位數編程所有數字的總和!

請用能被5和7整除的三位數編程所有數字的總和!

#包括

#包括

//找出能被3整除且至少有壹個數字為5的三位數。

(同Internationalorganizations)國際組織

主()

{

(同Internationalorganizations)國際組織

甲、乙、丙;

(同Internationalorganizations)國際組織

I,n = 0;

for(I = 100;我& lt=999;i++)

如果((i%3==0))

{

a = I/100;

//百位數

b =(I-a * 100)/10;

//十位數

c =(I-a * 100-b * 10);//壹位數

如果(a==5||b==5||c==5)

{

如果(n%10

==0)

printf(" \ n ");

n++;

printf("%d

“,我);

}

}

printf("\n

位數=%d”,n);

返回

0;

}

  • 上一篇:The server encountered an internal error () that prevented it from fulfilling this request.
  • 下一篇:街頭籃球地圖制作教程
  • copyright 2024編程學習大全網