输出结束是EOF,这个害我wa,水题,二进制转换为ascii

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int i,j;
    int ans=0,tes;
    char str[100];
    while(gets(str)!=NULL)
    {
        if(!strcmp(str,"___________")) continue;
        tes=0;
        for (i=0;str[i];i++)
        {
            if(str[i]=='o')
            {
                if(i<6) tes+=pow(2,8-i);
                else tes+=pow(2,9-i);
            }
        }
        printf("%c",tes);
    }
    return 0;
}

相关文章:

  • 2021-10-12
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-22
  • 2021-11-25
  • 2022-12-23
  • 2021-07-17
  • 2021-06-06
  • 2021-09-19
  • 2022-12-23
相关资源
相似解决方案