Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void vergleich(char *wort,char *buchstabe)
- {
- if(*wort=='\0')
- return;
- if(*wort==*buchstabe)
- {
- cout<<*wort;
- vergleich(wort+1,buchstabe);
- return;
- }
- else
- {
- cout<<"-";
- vergleich(wort+1,buchstabe);
- return;
- }
- }
- int main()
- {
- cout<<"Wort eingeben!"<<endl;
- char wort[50];
- cin>>wort;
- cout<<"buchstaben eingeben!"<<endl;
- char buchstabe[1];
- cin>>buchstabe;
- vergleich(wort,buchstabe);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement