#include"stdio.h"
void main()
{
long int total=1;
int n=1;
while(n<=10)
{
total*=n;
n++ ;
}
printf(“the result is %ld\n”,total);
}
#include"stdio.h"
main()
{
int day=0,buy=2;
float sum=0.0,ave;
do
{
sum+=0.8buy;
day++;
buy=2;
}while(buy<=100);
ave=sum/day;
printf("%f\n",ave);
}
#include"stdio.h"
void main()
{
int x, y, end=1;
int i;
printf(“please input x and y:\n”);
scanf("%d%d",&x,&y);
for (i=1;i<=y;i++)
end=end*x%1000;
printf("%d",end);
}
#include <stdio.h>
main()
{
int a,b,c;
for (a=1; a<=3; a++)
for (b=1; b<=3; b++)
for (c=1; c<=3; c++)
if (a!=1&&c!=1&&c!=3&&a!=b&&a!=c&&b!=c)
{
printf("%c will marry to a\n", 'x' + a - 1);
printf("%c will marry to b\n", 'x' + b - 1);
printf("%c will marry to c\n", 'x' + c - 1);
}
}