首页 > 代码库 > Marvelous Mazes UVA - 445

Marvelous Mazes UVA - 445

#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("\n");
            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("\n");
    }
    return 0;
}

 

Marvelous Mazes UVA - 445