Toggle navigation
Courses
Questions
Tags
Users
AC 20161207 exercise 1
0
like
0
dislike
3.1k
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)
|
3.1k
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)
** * * ***** *** * *****
*** ** * * * * * * ** * ** * **** is %s in *** ** *
********** ****** *** **
* * * * ******* * ******
** ** * *** * *
** ** * * * * ** * * * * * ** * ** *** * * * are no %s in * ** *
** ** * **** ****
}
answered
Jan 2, 2017
by
410425014
(
-162
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include *** ** *
#include ** ** *** *
int main ()
{
*** ** * ** ** **** * * * i;
* * **** ** ******* **** * s1[10],s2[10];
**** * * * ****** ** * ** * *** ** * * ** != EOF)
* * * * * *** * *** * ** * * * ***** * ** * ** * * ** ** != EOF)
** * * * * ** * * * * ** * * ** ** * * **** ** * * * **
}
void test(char *t1,char *t2)
{
* ** ************ ** = toupper(t1);
** *** * * ** *** * * * = toupper(t2);
**** ** ** * ** * ** * *** *loc = strstr(t1,t2);
** *** ****** ** * ** *** *** == NULL)
* * * * ** * ** **
* ** ** ** ** *** ** * *** * *** **** * * * *** ***** is %s in %s",t2,t1);
** * ** *** * * **
*** ** * * * ****** **
* * * ***** ****
* ** * ** ***** *** **** * *** ** * *** * ** * ** * ** * are no %s in %s",t2,t1);
** * * * * ***** *
}
answered
Jan 2, 2017
by
410425014
(
-162
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include <ctype.h>
int main(void)
{
* * **** * *** * * * *** * word[100];
* * * * * ** ** wordchange[100];
* * ** ** ** * * * *** ***** word2[100];
** * * *** ** * * word2change[100];
**** * * * * * * * ** *** i;
*** * ** ** ** ****** ** * * * *
***** ***** * * * * ***** * ** * ** * *
** **** * * * ** **** * *** * **** **** ***** ** ***
* * * *** * *** * *** * *** * ** ** ******* * **
*** ****** * * ** *** * * ** ** * * * ****** * ****** * * ** * * *** ** * *
* *** * * * ** * ** * * * * * * *** * * ***
*** *** ** ** *** ** * *** * * **** * ** ** ** ** ** ** ** * * **** ** *
* * * *** *** * * * * ********* * ** * *** ** * * ** ** **
* * * * * * * ***** * ** ** * *** *** * * *** *****
* * ** *** * *** ** ** ** * * *** *** * ** ** ** * ** * * **** * ** **** *** *
* **** ** * * * *** ***** * * * * ***** **
* ** ** * ** **** * * *** *** * *** ** * * * *** * ** ** ** ** * *** **
***** **** * * *** ** * * * ( strstr(wordchange,word2change) )
* ** * ** ********* ** * * ** * * *** ** is \"%s\" in \"%s\" ",word2,word);
* * * ** * *** * *
* *** * * * *** * * ** ** * ** * * *** are no \"%s\" in \"%s\" ",word2,word);
}
answered
Jan 2, 2017
by
410425016
(
-124
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include <ctype.h>
int main(void)
{
** * ** * ** * * *** * word[100];
* * *** * * * * * * wordchange[100];
* * ** * *** *** * **** * word2[100];
** * * * ** ** * ** word2change[100];
* * ** ** *** *** i;
** * * *** * * * *** * * * * * ** * ***
* ** * **** * *** ** ********* *** ** ** ** *
** ** * ** * ***** ** ** ** **** **** * ** ** *
* * * *** * *** *** * ** * ** * *** * * ** * * ***** ** * *
*** * * * * * * * ** * * * *** * ** * * * ****** **** * * ** ** * *** * ****** ** * ****
* * ** ******* **** * ** * *** ** **** *** * *
* * * * * * ** *** *** * **** ** **** ****** ******* ** * *** ** ** *** *
**** ** * ** ** ** **** * ** ** ***** ** * ********* **
* * * *** ******* * * * *** *** ** * * * ** * *** ** **
* * *** *** * * * * ******** * * * * ** *** *** ** ** *** ** *** *
* * * * * * * ** **** * * * ***** ** ***
* ** ** * *** * ** * * * ****** * *** * ** ** * *** * ** * * ** ** *
*** ** * ** * ***** *** ( strstr(wordchange,word2change) )
* * * **** * *** ** * * *** ***** * is \"%s\" in \"%s\" ",word2,word);
* * * ** * ** * * * * **
*** *** ** ** * *** * * * ** ******* * * * *** * * ** are no \"%s\" in \"%s\" ",word2,word);
}
answered
Jan 2, 2017
by
410425016
(
-124
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
*** *** ** ** *
** * * * ***** ***
* * * **** * ** *
int main(void)
{
****** ****** * ********* word[100];
* ** ** ** **** ** ** *** word2[100];
** * *** * ** * ** ** **
** * **** ** * ** * * * * **
** ** * * ****** * ( strstr(word,word2) )
* * * *** ** ** * ** ** * * * * **** * ******* * * * is * * * * * ** in * **** * * ",word2,word);
* * * ****** ** ***
*** * * * * ** * ****** ** ** ** **** * **** ** are no ** * * **** ** in **** * ***** ",word2,word);
}
answered
Jan 2, 2017
by
410425016
(
-124
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int main(){
** ** * ****** *** * a[100],b[100],x[100],y[100];
**** * * * *** * * *** *** i;
** * * ****** * * ***** *** ** %s",a,b);
*** *** * *** *** * ** * * **
* * ******* ** * * **** * * ** ** *** *
* * * * ** *** **** * * **** ** ** *
}
* * ** * ** * * **
*** ** * * * ***** **** ***** * ** **** * ** ***
** ****** * * * ** ****** *** ** ** * **** * ** * **** * * * ** * *
* ** * * * * ** *** * * ** ** ** * **** *
* * * *** ** *** * *** ***** * ** * * * **** * *
*** * * *** * * * ** **
** ** * ***** ** * * * * *
***** *** * * ***** **** ** **** *** * *** **** * * *
* * * ***** * * **** * * **** ** ** * ** * * *** * **
* * * *** **** ** ***** * **** * ******** ** *
* ** * * ******* **** ** ****** ***** ** *** *
******* * * * * *** * * ***
***** *** * *** *** *** * * * *
* ** **** ** * ** * * ***** ** ** * ** * * *** * * *** ** * * is \"%s\" in \"%s\"",b,a);
**** * ** * * * *** **
* * * * ** *** * *** **
** ** ** * ** ** **** * *** * *** ** * ***** * ** are no \"%s\" in \"%s\"",b,a);
** * * * * ***
** ** *** ** ** * 0;
}
answered
Jan 1, 2017
by
shihemi
(
-82
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(){
** ** *** * **** a[80], b[80], c[80], d[80];
* ** ** * * * * * *i;
* * *** ** * *** *** m, n;
* * ** * ** * * ** * * * ** *** * ** a, b);
*** * * ** ** * ** *** %s\n", a, b);
* ** *** *** * * = 0; m < 80; m++){
* * * *** **** ***** * * * * **
* * ** * * **** * *** * * ** * ** * ** ** * ** ** = tolower(a[m]);
** ** **** * * ** * ******* *
* ****** * ** * ** * * *** **** * ** * * * * * * * = a[m];
** ****** *
*** ** ********** = 0; n < 80; n++){
* * **** * ** * ***** ** * ** * * ** ** *
* * * * * * ** ** ** * * ** ** ** *** * * = tolower(b[n]);
******* * * **** * ** * * **** *
* ***** * * **** * * ** * * *** **** * ******** = b[n];
*** * ** ** ***
* * ** * ** ** = strstr(c, d);
* * ** * * ** ***** ** * *** * i);
* * * *** ** ** ** * != NULL)
** **** ** ** ** * * ** * * * * is \"%s\" in ***** ** * b, a);
* * * ** ** ***** ** *
* * **** ** ** **** ******* ** * ** * are no \"%s\" in * ** * ** * * ***** * b, a);
return 0;
}
answered
Dec 21, 2016
by
410342026
(
-105
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(){
* * **** *** ** a[80], b[80], c[80], d[80];
* * * * * ****** * *i;
* * ***** ** ** * * m, n;
** *** * ** * * ** ** * ** * **** *** *** a, b);
*** *** ** * ** * * * ** *** %s\n", a, b);
** * **** *** * = 0; m < 80; m++){
* ** **** ******* * * ** ** * * * * ** * * **
* * * * * * * ****** * ** * ****** ** *** **** ** * = tolower(a[m]);
** **** * * *** * ** ** * * * ** ***
** * ** * * * *** *** * * ** **** *** **** = a[m];
**** *** ***
** * * ** * * ** = 0; n < 80; n++){
** ***** *** * * * * *** * **** ****** *** * ** *
* * ** * *** ** *** ******** *** * * * **** * * ** ** = tolower(b[n]);
**** * ** ***** * ** **** * **** **
** ** *** * ***** * ****** * *** * * * **** * * = b[n];
* ** ** * **** ** ***
*** ** * * * *** = strstr(c, d);
* ** *** * *** * ***** ****** i);
* * * * * ** ** != NULL)
* * *** *** ** * * * ** * **** ** * ****** is\"%s\" in *** * *** *** *** ** b, a);
** * *** * **** ** *
*** **** ** * *** * * * *** * * * *** * are no\"%s\" in **** ** ** * b, a);
return 0;
}
answered
Dec 21, 2016
by
410342026
(
-105
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(){
**** * * **** * *** a[80], b[80], c[80], d[80];
********* * ** * * *i;
*** * ** *** m, n;
* * *** * * ** *** * ** * *** * * a, b);
* * ** * *** *** * *** *** * ** %s\n", a, b);
*** * *** ** **** *** * * = 0; m < 80; m++){
* ** ******* *** ** * * ** * ** ** ** * ***
* ** * ****** * ** * * ** * * ***** **** ** ** = tolower(a[m]);
**** * **** * ** *** * ** *** ****
***** * * ***** ** * ** *** * ** ** ** ** * * * * *** = a[m];
* **** ** * * *** *
*** *** * ** *** * = 0; n < 80; n++){
* * * * *** * **** * * ** * * ** ** *
* ** * *** * *** * * * *** * ** **** ****** ** ** * * *** = tolower(b[n]);
* * *** ** *** *** *** * * *
**** ** ****** * ** ** ** * * * * ** ** ** * * = b[n];
***** * * ** **
* * ** * * * ** = strstr(c, d);
** ** * ** ******** ** * ** * *** ****** i);
** * * * ** * ** != NULL)
* ** * * * *** * ** ** * *** * * ** * is\"%s\" in * ** * * * ** b, a);
** *** * * ** ****
*** * * *** * * *** ******** *********** ** ** are no\"%s\" in ** * * ***** * ** ***** b, a);
return 0;
}
answered
Dec 21, 2016
by
410342026
(
-105
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
**** ** **** *
** * * * ** ****
* * ** **** * *
int main(){
** * ** * * * a[80], b[80];
*** * ** *** *i;
** * ** * ** * **** ******* **** * * a, b);
* * * *** * ****** *** * * * ** %s\n", a, b);
*** * ** * * = strstr(a, b);
* * ** *** * ** ** * ** * i);
* * **** * * * *** != NULL)
* * * *** * ***** * *** *** ** * ** *** is\"%s\" in * * * * * *** *** * b, a);
*** ** ** * * * *** * *
****** *** ** ***** * * * ** * * *** ** * * * *** are * ** * ** in *** * ** * **** b, a);
return 0;
}
answered
Dec 21, 2016
by
410342026
(
-105
points)
ask related question
comment
Please
log in
or
register
to add a comment.
Page:
« prev
1
2
3
4
5
next »
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English
中文
Tiếng Việt
IP:172.70.100.13
©2016-2025
Related questions
0
like
0
dislike
0
answers
AC 20161207 上課投影片
[Resource]
asked
Dec 7, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 18872 -
Available when:
Unlimited
-
Due to:
Unlimited
|
46
views
0
like
0
dislike
10
answers
AC 20161207 exercise 2
[Exercise]
Essay (Open question)
-
asked
Dec 7, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 18876 -
Available when:
Unlimited
-
Due to:
Unlimited
|
1.1k
views
0
like
0
dislike
0
answers
Programming AC 檔案的存取教學影片1 (有六個影片)
[Resource]
asked
Dec 31, 2016
in
2016-1 程式設計(一)AC
by
laich
(
937
points)
ID: 20298 -
Available when:
Unlimited
-
Due to:
Unlimited
|
38
views
1
like
0
dislike
102
answers
AC 20161027 期中考 1
[Exercise]
Coding (C)
-
asked
Oct 27, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 15378 -
Available when:
2016-10-27 18:30:00
-
Due to:
2016-10-27 21:00:00
|
6.7k
views
0
like
0
dislike
39
answers
AC practice 1
[Normal]
Coding (C)
-
asked
Oct 11, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 13020 -
Available when:
Unlimited
-
Due to:
Unlimited
|
3.3k
views
12,783
questions
183,442
answers
172,219
comments
4,824
users