#include<iostream>
using namespace std;
int main()
{
char str1[100],n;
int i=0,js=0;
cout<<"请输入一个字符串和一个字符"<<endl;
cin.getline(str1,100);
cin>>n;
do {
if(str1[i]==n)
{
js=1;
break;
}
i++;
} while (str1[i]!='\0');
if(js==1)
{
cout<<"该字符及之后的字符是";
do {
cout<<str1[i];
i++;
} while (str1[i]!='\0');
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: