Advertisement
eric11144

word number show time

Jan 12th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4.  
  5. int main()
  6. {
  7. int times;
  8. char *s;
  9. char *k;
  10. char *str = (char*)malloc(sizeof(char));
  11. scanf("%s", str);
  12. int i;
  13. while( *str != '\0')
  14. {
  15. if(isalpha(*str))
  16. {
  17. s = str;
  18. }
  19. else
  20. {
  21. k = str;
  22. times = atoi(k);
  23. for(i = 0 ; i < times; i++)
  24. {
  25. printf("%c", *s);
  26. }
  27. }
  28. *str++ =='\0';
  29. }
  30. printf("\n");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement