zoukankan      html  css  js  c++  java
  • Marvelous Mazes UVA

    #include<iostream>
    #include<stdio.h>
    #include<string>
    #include<cstring>
    #define maxn 150
    using namespace std;
    char mapn[maxn][maxn];
    int main()
    {
        char str[150];
        while(gets(str)!=NULL)
        {
            int sum;
            for(int i=0;i<strlen(str);)
            {
                sum = 0;
                if(str[i] == '!')
                    printf("
    ");
                while(str[i]>='0'&&str[i]<='9')//数字累加,11累加为2
                {
                    sum += str[i] - '0';
                    i++;
                }
                if(str[i] == 'b')
                    str[i] = ' ';
                for(int j=0;j<sum;j++)
                    printf("%c",str[i]);
                i++;
            }
            printf("
    ");
        }
        return 0;
    }
    彼时当年少,莫负好时光。
  • 相关阅读:
    Rocket
    Rocket
    Rocket
    Rocket
    Scala
    Rocket
    Rocket
    Rocket
    Rocket
    Rocket
  • 原文地址:https://www.cnblogs.com/l609929321/p/6836413.html
Copyright © 2011-2022 走看看