2025-03-06 19:56:07 +08:00

16 lines
462 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.

/*-------------------------------------------------------
韩信点兵韩信带1500名士兵打仗战死四五百人站3人一排多出2人站5人一排多出4人站7人一排多出6人。编程计算还有多少士兵 (注使用for循环
-------------------------------------------------------*/
#include <stdio.h>
main()
{
int i;
/**********Program**********/
for(i=1000;i<1100;i++){
if(i%3==2 && i%5==4 && i%7==6)
/********** End **********/
printf("还有%d名士兵\n",i);
}
}