All pastes #209094 Raw Edit

Someone

public c v1 · immutable
#209094 ·published 2006-10-19 00:36 UTC
rendered paste body
#include <stdio.h>/* Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank */main (){  int c, space = 0, output, n;   char buffer[50];  do {    c = getchar();        if (c == 32)    {       ++space;    }    if (c != 32)    {      --space;    }        if  (space != 2)    {      output = output + c;    }  }while (c != EOF);  /*this is supposed to output the value stored in output which simply   * is all the text inputted minus any double spaces*/  n = sprintf(buffer, "%d", output);  printf ("[%s] %d", buffer,n); }