Crazy

sreduvanje na string

Dec 14th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. void Resenie(char *s){
  2.  
  3. int broj,i;
  4. int niza[150];
  5. memset(niza,0,sizeof(niza));
  6. for(i=0;i<strlen(s);i++){
  7.     broj=s[i];
  8.     niza[broj]=1;
  9. }
  10.  
  11. for(i=97;i<=122;i++){
  12.     if(niza[i]==1) printf("%c",i);
  13. }
  14.  
  15.  
  16. }
  17.  
  18.  
  19. int main(){
  20.  
  21.  
  22.  
  23.  
  24. char s[100],temp,temp1;
  25. int i=0;
  26. while((temp1=getchar())!='\n'){
  27.     if(temp1==' ') continue;
  28.     temp = tolower(temp1);
  29.     s[i]=temp;
  30.     i++;
  31. }
  32. s[i]='\0';
  33. Resenie(s);
  34.   return 0;
  35. }
Add Comment
Please, Sign In to add comment