Toggle navigation
Courses
Questions
Tags
Users
AD 20161208 exercise 1
0
like
0
dislike
600
views
子字串
請設計一個程式,使用者會輸入兩個字串,兩個字串間用一個空格隔開,每個字串的內容只會包含大小寫的英文字母,請判斷第二個字串是否出現在第一個字串內。請將大小寫視為同一個字。
輸入範例1:
friEND end
輸出範例1:
There is "end" in "friEND"
輸入範例2:
friEND friends
輸出範例2:
There are no "friends" in "friEND"
asked
Dec 8, 2016
in
2016-1 程式設計(一)AD
by
Shun-Po
(
18k
points)
|
600
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
23
Answers
0
like
0
dislike
Hidden content!#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[]) {
* * * * * * * * ** * * source[80];
*** * * ** * ** * search[80];
* *** * * *** * * *** *loc;
* * * ** * *
* * * ** * * * * ** ** *** * * **** * ** * * ***
** **** * * * * * ** * * * * *
* * * ** * * * ** ** *** * * * * * ** * * * *
*** * ** * * ** * **** ** * *
* * ** *** * ** ** *
* * ** **** * ****** *** ** * = strstr(source, search);
* * * ** * *** **** * * *
* * * * *** * * * * ** == NULL) {
* * *** *** ** * ** * *** * * * * * *** * ** ** ** * ** ** * ** * * ****
* * * * * ** * * * ** * **
* * * *** ** *** * ** * * {
*** * * ** * * * * ** * * * * * ** * ** * * * * ** ** * * * ** %d *** * ** ** ** ** *** loc - source);
*** * ** * * **
** ** * * * * ** *
**** * * * * ** ** * * *** * * * * * 0;
}
answered
Jan 7, 2017
by
410223045
(
-194
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!#include <stdio.h>
int main(void)
{
* * * * * * * * * * * ** string1[100], string2[100];