Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

prg-sem-sp / 2 / Задача18

.CPP
Скачиваний:
13
Добавлен:
28.03.2015
Размер:
959 б
Скачать
// “¤ «Ґ­ЁҐ з б⨠⥪бв , § Є«о祭­®© ў бЄ®ЎЄЁ (б® бЄ®ЎЄ ¬Ё!!!)! „®бв «Ё!!!!!!!
// …йҐ Ї а  з б®ў Ё п § ¤гиг Ѓ0‰Љ0!!! €«Ё ўлЄагзг ўҐ­вЁ«пв®а Ё§ Є®¬ЇмовҐа  (+30'C ў 9:00 ўҐзҐа !)!
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <alloc.h>
#include <string.h>
# define ENTER 13
void main (void)
 {int index,j,max=0;
  char ch,*txt=(char*)calloc(300,sizeof(char));
  clrscr();
  puts("ENTER-Є®­Ґж ўў®¤ :");
  for(index=0;(ch=getche())!=ENTER&&(index<300);index++)
    {txt[index]=ch;
    }txt[index]=NULL;
  puts("\n‚ и ⥪бв:");
  puts(txt);
  index=0;
  max=strlen(txt);
  while(txt[index]!=NULL)
  {if(txt[index]=='(')
   {while(txt[index]!=')')
    {for(j=index;j<max;j++)
     txt[j]=txt[j+1];
     max--;
     txt[max]=NULL;
    }
    for(j=index;j<max;j++)
    txt[j]=txt[j+1];
    max--;
    txt[max]=NULL;
   }
  index++;
  }
  puts("€§¬Ґ­Ґ­­л© ⥪бв:");
  puts(txt);
  free(txt);
  getche();
  }
Соседние файлы в папке 2