Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C by sacrimate ( 15 years ago )
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define r " ,.?!:;()"
int main() {
char s,text[100],*ptr1,*ptr2;
int n,f;
ptr1 = (char *)calloc (100, sizeof(char));
ptr2 = (char *)calloc (100, sizeof(char));
do {
 puts("Vvedite stroku");
 gets(text);
 ptr1 = strtok( text,r );
 }
while ( !ptr1 );
do {
 puts("Input symbol: ");
 scanf("%c",&s);
 }
while ( s == ' ');
n = strlen(ptr1);
for ( int i=0; i<n; i++) {
 f=0; 
 if ( ptr1[i] == s ) {
  for ( int j=i+1; j<n; j++) 
   if ( ptr1[j] == s ) f=1;
  }
 }
if (f) puts(ptr1);
}

 

Revise this Paste

Parent: 31022
Your Name: Code Language: