#include<stdio.h>
????main()
????{
?????float?sum;
?????int?flag=1,num=0,i=1,k,j;
?????while(sum*sum>=1/10^(-8))
????????{
????????num=num+i;
????????num=num+1;
????????sum=flag/num;
????????flag=(-1)*flag;
????????i++;
????????}
????????printf("f\n","sum");
????????sum=0;
????for(j=1;j<=20;j++)
????????{
????????scanf("%d",&k);
????????sum=sum+k;
????????}
????printf("Sum:%d\n",sum);
????printf("請(qǐng)輸入一行字符");
????scanf("%s",&m);//m有問(wèn)題:不是這個(gè)范圍的聲明。
????int?count1=0,count2=0,count3=0,count4;
????while((m=getchar())!='\n')
????????{
???????count3++;
???????if((m=getchar())='%d')//不知道下面這兩行的getchar()用對(duì)沒(méi)有。
????????{
????????????count1++;
????????????}else?if((m=getchar())='?')
????????????{
????????????count2++;
????????????}
????????}
????????????count4=count3-(count1+count2);
????????????printf("%d,%d,%d\n",count1,count2,count4);
????return?0;
????}
- 3 回答
- 0 關(guān)注
- 1878 瀏覽
添加回答
舉報(bào)
0/150
提交
取消