Toggle navigation
Courses
Questions
Tags
Users
AC 20161207 exercise 1
0
like
0
dislike
2.6k
views
子字串
請設計一個程式,使用者會輸入兩個字串,兩個字串間用一個空格隔開,每個字串的內容只會包含大小寫的英文字母,請判斷第二個字串是否出現在第一個字串內。請將大小寫視為同一個字。
輸入範例1:
friEND end
輸出範例1:
There is "end" in "friEND"
輸入範例2:
friEND friends
輸出範例2:
There are no "friends" in "friEND"
asked
Dec 7, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
|
2.6k
views
answer
comment
Please
log in
or
register
to add a comment.
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Add answer
Cancel
44
Answers
0
like
0
dislike
Hidden content!#include * * * *** **
#include ** ** * * * * *
void test(char *t1,char *t2);
int main ()
{
* * ** ** ** **** *** * * * * s1[10],s2[10];
* *** * * * *** * * * * *** ********* * != EOF)
* *** * * * * * ** *** * * * ** * * *** * ** * * ** * * ** * ** != EOF)
** ** * * * *** * *** ** *** ** * *** * * * ** * * ** * ** ** ** * ** ** * * * * ***
}
void test(char *t1,char *t2)
{
* *** **** * * * * = toupper(t1);
** * ** ** * * = toupper(t2);
** ** ** * * * * ** ** *loc = strstr(t1,t2);
* * * * * * * * * * == NULL)
** ** * * * * * * *** * ** *