CCF201604-02

Posted Magic_chao不负青春

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CCF201604-02相关的知识,希望对你有一定的参考价值。

#include<iostream>
using namespace std;
int main(){
    int m[15][10],s[4][4],n;
    for(int i=0;i<15;i++){
        for(int j=0;j<10;j++){
            cin>>m[i][j];
        }
    }
    for(int i=0;i<4;i++){
        for(int j=0;j<4;j++){
            cin>>s[i][j];
        }
    }
    cin>>n;
    for(int i=14;i>=0;i--){
        for(int j=n-1;j<n-1+4;j++){
            for(int k=3;k>=0;k--){
                for(int p=0;p<4;p++){
                    if(m[i][j]==1&&s[k][p]==1){
                        int temp=i;
                        while(m[temp][j]==1){
                            temp--;
                        }
                        m[temp][j]=1;
                    }else if(m[i][j]==0&&s[k][p]==1){
                        m[i][j]=1;
                    }
                }
            }
        }
    }
    for(int i=0;i<15;i++){
        for(int j=0;j<10;j++){
            cout<<m[i][j]<<" ";
        }
        cout<<endl;
    }
    return 0;
}

 

以上是关于CCF201604-02的主要内容,如果未能解决你的问题,请参考以下文章

CCF推荐系统项目代码解读!

CCF CSP 202109赛题练习

ccf 201903-4 消息传递接口 100

CCF CSP历年一二题代码汇总

CCF-权限查询-201612-3

CCF-201509-3-模板生成系统