Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define SIZE 5
- int main(void) {
- char v[SIZE] = "abcde";
- char c;
- char res;
- scanf("%c", &c);
- for(int i = 0; i < SIZE - 1; i++) {
- if(v[i] < c && c < v[i+1]) {
- res = v[i+1];
- v[i+1] = c;
- SIZE++;
- for(j = i+1; j < SIZE + 1; j++) {
- v[j] = res;
- res = v[j+1];
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement