#include <stdio.h>
//s=1-3+5-7+....-99+101
main()
{
    int i,t=1,s=0;
    for(i=1;i<=101;i+=2)
    {
        t=t*i;
        s=s+t;
        t=-t/i;
    }
    printf("%d\n",s);
 getchar();
 }

 

#include <stdio.h>
//s=1-3+5-7+....-99+101
main()
{
    int i,t=1,s=0;
    for(i=1;i<=101;i+=2)
    {
        t=t*i;
        s=s+t;
        t=-i/t;
    }
    printf("%d\n",s);
 getchar();
 }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2021-09-14
  • 2022-01-17
  • 2022-12-23
相关资源
相似解决方案