Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void vergleich(char *wort,char *buchstabe)
  6. {
  7. if(*wort=='\0')
  8. return;
  9. if(*wort==*buchstabe)
  10. {
  11. cout<<*wort;
  12. vergleich(wort+1,buchstabe);
  13. return;
  14. }
  15. else
  16. {
  17. cout<<"-";
  18. vergleich(wort+1,buchstabe);
  19. return;
  20. }
  21.  
  22. }
  23.  
  24. int main()
  25. {
  26. cout<<"Wort eingeben!"<<endl;
  27. char wort[50];
  28. cin>>wort;
  29.  
  30.  
  31. cout<<"buchstaben eingeben!"<<endl;
  32. char buchstabe[1];
  33. cin>>buchstabe;
  34.  
  35.  
  36. vergleich(wort,buchstabe);
  37.  
  38.  
  39.  
  40.  
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement