Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define MAX_LINE 100
- int detab (string, limit)
- char string [];
- int limit;
- {
- char c;
- int i = 0, j = 0, temp = 0;
- for (i = 0; (i < (limit - 1)) && (c = getchar ()) != '\n'; i += 1 + temp)
- {
- if (c != '\n' && c != '\t')
- {
- string [i] = c;
- }
- else if (c == '\t')
- {
- for (j = 0; j < 10; j++)
- string [i + j] = '-';
- temp += j;
- }
- else
- {
- string [i] = '\0';
- }
- }
- return (i + temp);
- }
- int main()
- {
- char parola [MAX_LINE];
- int lung = 0, i = 0;
- while ((lung = detab(parola, MAX_LINE)) > 0)
- {
- for (i = 0; i < lung; i++)
- printf("%c", parola [i]);
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement