delete pics to save space
This commit is contained in:
23
history_source/信息学奥赛一本通/1.8.3.cpp
Normal file
23
history_source/信息学奥赛一本通/1.8.3.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include<cstdio>
|
||||
using namespace std;
|
||||
char* find(char *front,char *last,char n)
|
||||
{
|
||||
while(front<last)
|
||||
{
|
||||
if(*front==n) return front;
|
||||
front++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
char s[1000],n;
|
||||
int len=-1;
|
||||
while(s[++len]=getchar(),s[len]!='\n');
|
||||
n=getchar();
|
||||
char *p=find(s,s+len,n);
|
||||
if(p==NULL) printf("no\n");
|
||||
else printf("%d\n",p-s+1);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user