展开全部#include include include include define n 30 define cyc 5000 int main() { double b=0.8;double c[n];int spore[cyc];int i,j;double r=0.0;double x=0.0;srand((unsigned)time(**));file*ptr;ptr=fopen("re...
int n; scanf("%d",&n); for( int i = 1; i <= n; i++) { for ( int j = n-i; j > 0; j--) printf(" "); for ( int k = 1; k <= 2*i-1; k++ ) printf("*"); printf(...
方法利用循环解决问题,设循环变量为 i,初值为 1,i 从 1 变化到 n;依次让 i 与 sum 相乘,并将乘积赋给 sum。① 定义变量 sum,并赋初值 1。② i 自增 1。③ 直到 i 超过 n。程序代码如下 include int main() { int i,n;double sum=1;scanf("%d",&n);for(i=1;i;i+) sum=sum*i;printf("%...