zoukankan      html  css  js  c++  java
  • codeforces 711A A. Bus to Udayland(水题)

    题目链接:

    A. Bus to Udayland

    题意:

    找一对空位坐下来,水;

    思路:

     

    AC代码:

    #include <iostream>
    #include <cstdio>
    #include <cstring>
    #include <algorithm>
    #include <cmath>
    #include <bits/stdc++.h>
    #include <stack>
    #include <map>
     
    using namespace std;
     
    #define For(i,j,n) for(int i=j;i<=n;i++)
    #define mst(ss,b) memset(ss,b,sizeof(ss));
     
    typedef  long long LL;
     
    template<class T> void read(T&num) {
        char CH; bool F=false;
        for(CH=getchar();CH<'0'||CH>'9';F= CH=='-',CH=getchar());
        for(num=0;CH>='0'&&CH<='9';num=num*10+CH-'0',CH=getchar());
        F && (num=-num);
    }
    int stk[70], tp;
    template<class T> inline void print(T p) {
        if(!p) { puts("0"); return; }
        while(p) stk[++ tp] = p%10, p/=10;
        while(tp) putchar(stk[tp--] + '0');
        putchar('
    ');
    }
     
    const LL mod=1e9+7;
    const double PI=acos(-1.0);
    const int inf=1e9;
    const int N=1e5+20;
    const int maxn=4e3+220;
    const double eps=1e-12;
    
    char s[2000][10];
    
    int main()
    {
        int n,flag=0;
        read(n);
        For(i,1,n)scanf("%s",s[i]);
        For(i,1,n)
        {
            if(s[i][0]=='O'&&s[i][1]=='O')
            {
                flag=1;
                s[i][0]='+';
                s[i][1]='+';
                break;
            }
            if(s[i][3]=='O'&&s[i][4]=='O')
            {
                flag=1;
                s[i][3]='+';
                s[i][4]='+';
                break;
            }
        }
        if(flag)
        {
            cout<<"YES
    ";
            For(i,1,n)
            {
                for(int j=0;j<=4;j++)printf("%c",s[i][j]);
                    printf("
    ");
            }
        }
        else cout<<"NO
    ";
        return 0;
    }
    

      

  • 相关阅读:
    JS-instanceof 与typeof
    JS-面向对象相关
    spark job源代码物理执行图实战
    堆(heap)和栈(stack)的区别
    sql developer怎样调试Pipelined
    oracle dbms_output 在java中输出
    sed 用法笔记
    oracle 怎样建自增长字段
    python学习笔记--split与join用法
    如何开启php报错
  • 原文地址:https://www.cnblogs.com/zhangchengc919/p/5820628.html
Copyright © 2011-2022 走看看