Advertisement
Pavle_nis

C REMOVE BLANK SPACE

Mar 22nd, 2017
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. // Stringovi 8.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <stdio.h>
  6. #include <string.h>
  7.  
  8. int main()
  9. {
  10.     char s1[80];
  11.     int i = 0, s = 0, j = 0, pom, duzina = 0;
  12.     printf("Unesi string:");
  13.     gets(s1);
  14.  
  15.     while (s1[i] != ' ')
  16.         i++;
  17.         s = i;
  18.  
  19.     duzina = strlen(s1);
  20.     pom = s1[s];
  21.     for (j = s; j<duzina; j++)
  22.         s1[j] = s1[j + 1];
  23.     s1[duzina - 1] = pom;
  24.  
  25.     puts(s1);
  26.     _getch();
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement