UVa 445 Marvelous Mazes

UVa 445 Marvelous Mazes
Here is my code:
#include < stdio.h >
#include
< iostream >
#include
< string >
using   namespace  std;

int  len;
string  s;

int  main()
{
    
/*
    freopen("data.in","r",stdin);
    freopen("data.out","w",stdout);
    //
*/
    
while (getline(cin,s))
    {
        len
= s.length();
        
for ( int  i = 0 ;i < len;i ++ )
        {
            
int  counter = 0 ;
            
while (s[i] >= ' 0 ' && s[i] <= ' 9 ' )
            {
                counter
+= (s[i] - ' 0 ' );
                i
++ ;
            }
            
for ( int  j = 1 ;j <= counter;j ++ )
                cout
<< (s[i] == ' b ' ? '   ' :s[i]);
            
if (s[i] == ' ! ' ) cout << endl;
        }
        cout
<< endl;
    }
return   0 ;
}

你可能感兴趣的:(UVa 445 Marvelous Mazes)