1908 我不会做

版权声明:本文是博主乱写的文章,可以随便转载 https://blog.csdn.net/weixin_43768644/article/details/89437309

题目链接:http://47.96.116.66/problem.php?id=1908

解题思路:

暴力判断,注意输出那个字符串的几个细节:

       [string*X]代表连续输出string字符串X(向上取整)次  

这句话注意两点:①输出的时候没有【】  ②向上取整可以用<math.h>中的ceil函数,或者自己判断一下

      注意??+其他一个字符   在评测的时候会作如下的转换,所以要分开输出,以后要注意一下。

 ??= #
 ??/  \
 ??'  ^
 ??(  [
 ??)  ]
 ??<  {
 ??>  }
 ??!  |
 ??-  

代码:

#include<cstdio>
#include<cmath>

int main()
{
    int t;
    scanf("%d",&t);
    while (t--){
        double x;
        scanf("%lf",&x);
        int y = (int)x;
        int cnt=0;
        while (y){
            if (y&1) cnt++;
            else break;
            y>>=1;
        }
        if (y==0 && cnt>0) printf("%d\n",cnt);
        else {
            if (x!=(int)x) y=(int)x +1;
            printf("Areyou");
            for (int i=0;i<y;i++) printf("really");
            printf("sure??");
            printf("):");
            for (int i=0;i<y;i++) printf("pardon");
            printf("???");
            printf("\n");
        }
    }
    return 0;
}

没有账号密码可以用这个:zstu4m41    8D6C37DF51

猜你喜欢

转载自blog.csdn.net/weixin_43768644/article/details/89437309