Skip to content

Instantly share code, notes, and snippets.

@KT-Yeh
Created February 3, 2014 09:58
Show Gist options
  • Save KT-Yeh/8781229 to your computer and use it in GitHub Desktop.
Save KT-Yeh/8781229 to your computer and use it in GitHub Desktop.
#include <cstdio>
using namespace std;
int main()
{
// freopen ("input.txt","rt",stdin);
char c;
int num=0;
while (c=getchar()){
if (c == EOF) break;
if (c == '\n' || c == '!')
printf("\n");
else if (c >= '0' && c <= '9')
num += (c - '0');
else{
if (c == 'b'){
for (int i=0; i<num; i++)
printf(" ");
}
else {
for (int i=0; i<num; i++)
printf("%c",c);
}
num = 0;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment