[ Neverall @ 22.07.2005. 12:39 ] @
#include <stdio.h>
main()
{
int c;
while((c=getchar()) != EOF)
{

while (c!=' ')
{ putchar(c);
c=getchar();
}
c=getchar();
putchar();
}
}
OVAJ PROGRAM KOPIRA TEKST I NE ISPISUJE PRAZNINE.
KAKO DA PROGRAM KOPIRA TEKST I UKLONI PRAZNINE SAMO AKO IH IMA DVIJE ILI
VISE U NIZU..
Hvala!
[ rumpl @ 22.07.2005. 13:49 ] @
Code:

#include <stdio.h>

int main(int argc, char **argv)
{
  int i;
  int c;
       
  i = 0;

  do
    {
      while ( (c = getchar()) == ' ')
    {
      if(i == 0)
        {
          putchar(c);
          i++;
        }
    }
      
      i = 0;

      putchar(c);
    }
  while( c != EOF );

  return(0);
}


Nadam se da si na ovo mislio, program ispisuje sve
razmake a ako ih ima vise, ispisuje samo jedan...
Pozdrav


Reality is an illusion that occurs due to lack of alcohol.




____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs