Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <Windows.h>
- #include <locale.h>
- int main() {
- setlocale(LC_ALL, "ukr");
- char str[100];
- int count = 0;
- printf("Введіть рядок із цифр(від 1 до 9): ");
- gets_s(str);
- for (int i = 0; i < strlen(str); i++) {
- if (!isdigit(str[i])) {
- for (int i = 0; i < 2; i++) {
- int tmp = str[0];
- for (int i = 0; i < strlen(str) - 1; i++) {
- str[i] = str[i + 1];
- str[strlen(str) - 1] = tmp;
- }
- }
- }
- }
- for (int i = 0; i < strlen(str); i++) {
- if (!isspace(str[i]))
- printf("%d ", str[i] - '0');
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement