c语言编程题

时间:2013.11.25 发布人:木头4965774

c语言编程题

已解决问题

谷歌木头4965774用户在2013.11.25提交了关于“长安cs75c语言编程题”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2025-02-15T02:09:17。希望大家能够帮助她。

详细问题描述及疑问:期待您的答案,谢谢你帮我,祝你快乐,愿你事事如意 !

希望以下的回答,能够帮助你。

第1个回答

用户名:lushun1000  

题目6:
#include<stdio.h>
main()
{
intman,woman;
for(man=0;man<100;man++)
for(woman=0;woman<100;woman++)
if((man*man+w必怎系镇积oman==1053)&&(man+woman*woman==873))
printf("man=%d,woman=%d",man,woman);
getch(煤种食木灯);
}
结果:man=32,woman=29

题目7:
#include<stdio.h>
#defineN3
main()
{
inti,j;
for(i=1汽察;i<=N;i++)
{
for(j=1;j<=改油极神工加评伟们先星2*i-1;j+=2)
printf("*");
printf("\n");
}
for(i=N+1;i<2*N;i++)
{
for(j=2物至属还激全杨总乱又*N-i;j>=1;j--)
printf("*");
printf("\n");
}
getch();
}

题目1:
#include<stdio.h>
#defineN9
main()
{
floatx;
inti;
float_si对故帝身规安是白n(float);
intfactorial(int);
floatpo跑头矛层际wer(float,i游川攻跳晚青干身底nt);
printf("Pleaseinputx=:\nInput0toexit\n");
while(scanf("%f",&x))
{
fflush(stdin);
if(x==0)exit(1);
printf("sin(%7.4f)=%7.4f\n",x,_sin(x));
system("pause");
system("cls");
fflush(stdin);
printf("Pleaseinputx=:\nInput0toexit\n");
}
getch();
晶}
intfacto承兴体十据乎微背感队尔rial(intx)
{
intresult;
i市神松f(x==0)return1;
else
{result=x*factorial(x-1);
returnresult;}
}
floatpower(floatx,intn)
{
inti=1;
floatr顺西缺拿名孙材核厂特门esult=1;
while(i<=n)
{result*=x;i++;}
returnresult;
}

float_sin(floatx)
{
inti;
floatpower(float,int);
floatsum=0;
for(i=1;i<=N;i++)
sum+=power(-1,i-1)*power(x,2*i-1)/factorial(2*i-1);
returnsum;
}
结果:0.4794