大佬可以帮我看下我第二题代码吗? #include<iostream> using namespace std; int book[64]; int main() {     int t;     while (cin >> t)     {         for (int p = 0; p<t; ++p)         {             long long x, k;             cin >> x >> k;             for (long i = 0; i < 64; ++i)             {                 long long u = 1;                 if (!(x&((u << i))))                     book[i] = 1;             }             long long result = 0;             for (int i = 0; i < 64; ++i)             {                 long long u = 1;                 if ((k&(u << i)))                 {                     int j = 0;                     int q = 0;                     while (j < 64)                     {                         if (book[j] == 1)                             q++;                         if (q == (i + 1))                             break;                         j++;                     }                     long long v = 1;                     result |= (v << j);                 }             }             cout << result << endl;         }     } }
点赞 4

相关推荐

某牛奶:一觉醒来全球程序员能力下降200%,小伙成功scanf惊呆在座个人。
点赞 评论 收藏
分享
孤寡孤寡的牛牛很热情:为什么我2本9硕投了很多,都是简历或者挂,难道那个恶心人的测评真的得认真做吗
点赞 评论 收藏
分享
牛客网
牛客企业服务