题解 | #压缩二维码#

压缩二维码

https://www.nowcoder.com/practice/1150d36c2cd64df9bf373988486c6723

#include <bits/stdc++.h>
using namespace std;
//每4个一组,有pow(2,2*n)/4,遍历输出就行
int main() {
    int n,ans=0;
    cin>>n;
    char c;
    int p[4]={1,2,4,8};
    for(int i=1;i<=pow(2,2*n)/4;i++){
        int num=0;
        for(int j=3;j>=0;j--){
            cin>>c;
            if(c=='#')
            num+=p[j];
        }
        cout<<num<<' ';
    }
}

全部评论

相关推荐

饿魔:看到在线简历了吧
点赞 评论 收藏
分享
评论
5
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务