Guest User

Untitled

a guest
Dec 11th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. char c,ca;
  8. printf("%d",c-48);
  9. int num=0,cont=0,aux=0;
  10. int con=0;
  11. freopen("entrada.c","r",stdin);
  12. while(scanf("%c",&c)!=EOF&&con<=132) {
  13. con++;
  14. if(c>='1'&&c<='9'){
  15. aux=num;
  16. num=c-48;
  17. cont++;
  18. if(cont>1)
  19. num=num+aux;
  20. }
  21. if(c=='!')
  22. {
  23. printf("\n");
  24. cont=0;
  25. }
  26. if(c=='\n')
  27. {
  28. printf("\n");
  29. cont=0;
  30. }
  31. if(c=='b'){
  32. for(int j=0;j<num;j++) { printf(" ");
  33. cont=0;}
  34. }
  35. if(c=='*'){ for(int m=0;m<num;m++)
  36. { printf("*");
  37. cont=0;}
  38. }
  39. if(c>='A'&&c<='Z'){ for(int i=0;i<num;i++)
  40. { printf("%c",c);
  41. cont=0;
  42. }
  43. }
  44. }
  45. return 0;
  46. }
Add Comment
Please, Sign In to add comment