2025-03-06 22:45:14 +08:00

25 lines
438 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
编程求所有能被3且能被5且能被7整除的三位数并输出每个数字占5字符宽度5个一行
-------------------------------------------------------*/
#include <stdio.h>
main()
{
int i,k;
k=0;
for(i=100;i<=999;i++)
{
/**********Program**********/
if(i%3 ==0 && i%5==0 && i%7==0){
/********** End **********/
printf("%5d",i);
k++;
if(k%5==0)
printf("\n");
}
}
}