c语言:1。#include "math.h"
#include <stdio.h>int main()
{
int m,i,k,h=0,leap=1;
printf("\n");
for(m=101;m<=200;m++)
{
k=sqrt(m+1);
for(i=2;i<=k;i++)
if(m%i==0)
{
leap=0;break;
}
if(leap)
{
printf("%-4d",m);
h++;
if(h%10==0)
printf("\n");
}
leap=1;
}
printf("\nThe total is %d",h);
getchar();
return 0;
} 2。#include <stdio.h>int main()
{
int day,x1,x2;
day=9;
x2=1;
while(day>0)
{
x1=(x2+1)*2; /*第一天的桃子数是第2天桃子数加1后的2倍*/
x2=x1;
day--;
}
printf("the total is %d\n",x1);
getchar(); return 0;
}
温馨提示:内容为网友见解,仅供参考