Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <stdio.h>
- int main()
- {
- char stroka[100], t;
- char * pch;
- int i, j, n;
- printf("Vvedite stroku ");
- gets(stroka);
- n = strlen(stroka);
- for (i = 0; i < n - 1; i++)
- {
- if (isdigit(stroka[i]))
- {
- for (i = 0; i < n - 1; i++)
- {
- for (j = 0; j<n - i - 1; j++)
- {
- if (stroka[j]>stroka[j + 1])
- {
- t = stroka[j];
- stroka[j] = stroka[j + 1];
- stroka[j + 1] = t;
- }
- }
- }
- }
- }
- printf("Splitting string \"%s\" into tokens:\n", stroka);
- pch = strtok(stroka, " ");
- while (pch != NULL)
- {
- printf("%s\n", pch);
- pch = strtok(NULL, " ,.-");
- }
- printf("Stroka po vozrastaniy:");
- printf("%s", stroka);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement