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<stdio.h>
#include<stdlib.h>
int main()
{
** * ** ******* *** * * am,b,c,i,j,k,l,m,o,p;
* ** * * * * * ** ** * *** *** * ** ** ***
* **** ** * * * *** ** * *** ****** *
* **** *** *** * *** **** *
* *** * * * ** ** * * **
* ** * *** *** *** *
** ** * ** ***** ** * * * ** * * * * *** * * ***** *** * ** *
* * ** * *** * ** * * * ** * ** ** **** ** ** * * ** ****
** * * * **** * ** *** ** *** * * ******* *** * * *** *** * * *
* **** ****** * ** * * * * ** * ** ** ** * ** * * ** * ** *
** * *** * * ** * ** ** * ****** * ***** * *** * * * *** * * * * ** ** * * * * **
* ** *** * * ** * * **** ** ****** **** *** * *** ** * * ******* * *** *** **** * ***** **** *** * ** *** *
* *** * * *** ** **** * * * *** * ** * * * *** ***** * * * ** * * ** ** ** * ** * ** ***** * * ** *** *
* * ** **** *** ** ** ** * * ** *** ** ** * ** * * * * ********* * ** * **** ** * ** ** ** ** * * *** * ** ** ** **** ** ** ****
** * *** * **** ** * * **** * * * ** * * * * ** ******** * * * * *** *** * ** * * * ** * * ****** ***
** ** *** ** * * **** **** * *** * ** * * *********** * ** * *** **** * * * **** ** * ** * * * ** ** ** *** * **** *** *
* * * **** ** * *** ** *** * * * * * *** *** * * *** ** * ** *** * ** * ** * ****** ** * * ** * *** ** ****
********* *** ** * ** ** *** * * * *** * ** * ** * * *** ** * * * * * * * * **** * ** ** ****** * *** * * *** * * **
* ** * * *** ****** **** * *** * * * * * * ** ** * * ** * * * * ** ** * **** * * ** *
* * ** * ** * * ****** ** ** **** ** * ** * ** *** * ** *** * * * * * **** ** ** ** *** ** ***** * * ** * ; p>=1 ; p=p-1)
*** ** ** * * * * ** * * * ** ** *** ** ** * ** * ** * * *** *** **** ** * ******* * ** * * * * * ** * * *** ****
* * ***** * * * ** * ** *** * ** ****** * * * * * **** * * * * ** ****** *** * *** ** * ** * **** * **
* * * ** **** ** ** * * * ** * ** ** * * * *** ****** ** * * * * * * * *** ** * ***** * * * ***** ** **** ** ****** **** * * *
*** * * * *** * * ** * ** ** *** * ** ** *** * * ** * * **** ** * * ** * **** ** ** * * * * * ** * * ******* *** *
**** * ** * * * ********** ** * * * * * *** **
*** * ** * **
* * ** ** * * **** ** * ***** **** ** * * *
**** * *** * * * 0;
}
*** * ** ** * *** * ** ** * ** * ** ***** += c[i].r;
* * * ****** ** ***** * ***** * * ** *
* * * * ** * **** * * * * ** *** * * * **** ****** += c[i].g;
** **** * * ** * *** **** ** * ****** * * *******
** * * ** * ****** * ** * ** **** ******* += c[i].b;
* ** * * * *** ** ** * *** **** * ** ** **
* * *** *** *****
* ** * * *** ***** * * ** * * = sr/n;
*** * * ** * *** * * * = sg/n;
*** ** * * *** * ** ** **** *
***** * * *** * ** ** * = sb/n;
* ****** *** ******* ***
** ** **** ** ** * ** * ** avg;
};
double brightness(struct Color c)
{
*** ** * * **** * ****** bright;
** * * *** * * * * = (c.r + c.g + c.b) / 3;
** * ** ** * ** ** bright;
* * ** * ** *
}
void printColor(struct Color *c)
{
** *** * * ***** * * * ("(%d,%d,%d) ** ***** * * * ** * *** ** *
*** * ** * * ** ** * *
}
#endif
安安 說 (23:36):
9753]AC 20161221 exercise 2
[16865]AC 20161102 作業2
[17203]AC 20161109 exercise 1
AC 20161207 exercise 1
quietiest 說 (23:38):
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
int main()
{
* **** * * ** * ** ** ** * i=0,j=0,t;
* * * ** * ******* ch,xh;
* **** ** *** **** * * *** a[100],c[100]={0};
* * ** ***** * b[100],d[100];
* * ** *** ** ** ((ch = getchar()) != 32) {
* * *** *** ** * ** ****** * * ** ******* = ch;
*** ***** ** * ** ** *** * * * *** ****
**** ********* * * *
* **** * * * * ** *** * * * = '\0';
* * * * * * ********** * * = getchar()) != '\r') {
* * * * ** * * *** * * ** * *** ** * ** * * = xh;
* ** * ** ** * *** * ** ** * *** * * * * *
* *** ********* * *** * *
** ***** * * * ** ** ** = '\0';
** * * * * * * **** * ** *** ***** ** {
* ** * * * * * ** *** * * * ** * *** *** * * * *
* * ** ** ********* *** * ***** * * * * ***** *** * **** * *** {
*** * * *** * **** * * *** *** * * * * * ** * ******* ** * **** * **
***** ** * * **** * * **** *** ** ** * *****
* ** *** * * ** * *** ***
* ** ** *** ** ** ** * * ** {
*** ** * * * ****** ** * ** ** *** * **** *******
*** * * * * *** ** *** ** * * * *** * ***** *** {
** ** * * ** **** * * ** **** **** *** ** * * * * ** ** * * * ** * **** *
* * * ** **** * * * * * * * * *** ** * * **
* ** * ** * *** *
* ** * * ** **** * * *** ** *** {
** ** ** * ** * * * **** * ** * ** ** * *** * ** is \"%s\" in \"%s\"",d,c);
** *** ** ** * **** * ** ***
** * * * * *** **** {
**** ** * * * ** * * ** * ****** * *** ***** * * ******* ** ** are no \"%s\" in \"%s\"",d,c);
** *** * * *** * * ** * **
** **** * ** ** * *** * ** * * * * **
**** *** * ** ******** * * * 0;
}
answered
Jan 5, 2017
by
Noah1011
(
43
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
int main(void)
{
** *** * * * ** * *** * *prt;
**** *** ** * * *** * * string1[40];
* * * *** ** ** ** string2[40];
int i;
* * ******* *
** * * * *** * **
* * * * ** ****
prt= ** * * * * * **
if(prt == NULL)
* * ** ** * *** * ** **** are no * * ** ** *** ** in *** ** * * ** * ******* ***
else
* * ** ** ** ** * ****** *** * ** ** is *** ** ** * in * *** * **** * * * *
}
answered
Jan 5, 2017
by
羅祖嘉
(
-248
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include * ** *** *** ***
#include ** * **
#define LENGTH 80
int main(void) {
***** * * *** z[LENGTH];
* *** * * * ***** * k[LENGTH];
** * *** * * * ** ***** *** LENGTH, stdin);
*** *** * * *** *** ***** * LENGTH, stdin);
*** * ** *** ***** * * ** ** - 1] = '\0';
***** * * * * ** *loc = strstr(z,k);
**** ** ** * ***** * * * * * == NULL) {
*** * ** ****** *** **** ** *** * ** * **** ** * * are no %s in ** *** * * *
* * **** ** *
* ****** *** * * *** * {
* *** *** * * *** * * ** ** * *** *** * * * * ** * is %s in *** * k, z); * * ** ** * *** *** *** * * **** ** ** * **** ** *** **** * - z
* * *** *** **
* * * ***** *** * * *** 0;
}
answered
Jan 5, 2017
by
410523030
(
-34
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main ( void )
{
* ** * ** * ** * ** *** * i,j;
***** * * * *** ***** ** *** * *** * * * * * * *** *
* * * **** *** ** ** ** ****** ** * * *****
**** ** ** *** * ** * **** **** *** *
*** ** ** * * * **** ** *
** * **** * ** **** *
* * * * * ** * ** ** ** * ** ** ** ** ***** ** * = s1[i];
** * **** ** **** ** * ***** * * *** **** = tolower(c1);
* * ***** **** * ** * * ** ****** ** * * * * = c1;
* * * * **** **** * ** *
*** * *** *
* * ** * **** ******* * ** ***
* ****** ** * ** * ** *
*** *** *** * ** * ** * * *** * * = s2[j];
********* * *** *** * * *** * ** * ***** * * * = tolower(c2);
* *** ** * ** ** ** ** * *** ** * * *** * = c2;
* * ** * *** * *
* **** *** ** * **
** * * ** ** * * * = strstr(a,b);
* * * * *** * *** ** ***
* * * * * ** ** * * * *** * *** ** *** ** ** ******* * * *** are no %c%s%c in %c%s%c",c,s2,c,c,s1,c);
**** *** * * ** * * * *** ****
* * * ** * * * * * ** ***** ***** ***** * * * ** is %c%s%c in ******* *
********* * ** * * * *** 0;
}
answered
Jan 5, 2017
by
林宗鴻
(
-72
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include *** ** **
#include **** ** ** * *
int main(void){
* *** * * ** * *** * ** * ***
** * * ** ** * * i,j,k = 0;
* * ****** * ** = '"';
****** * **** * * * **** ** *** * ** * *** ******
* *** * ** *** ** *
* * * * * * * *** = 0;i < strlen(a);i++)
* * ** * ** **** *** = a[i];
** * ** * ** * * = 0;i < strlen(b);i++)
*** ** ** ** * * * ** ** ** = b[i];
**** **** ** * ***** = 0;i < strlen(a);i++){
* ***** * *** *** * * * * < 97)
* ** * * ****** **** ** *** ** = ch[i] + 32;
** *** *** * * *
*** * *** ***** * = 0;i < strlen(b);i++){
* ** * **** * **** * *** < 97)
*** * ** ** * *** ** * ** * = dh[i] + 32;
* * ***** * *
* ***** ** = 0;i < *** *** ** * * ** **
* * * * ** ** * = 0;j < strlen(b);j++){
* * * ** * ** *** * ** ***** ** **** * * * * + j] == dh[j])
** * * * * **** * **** * ** * * * ** = k + 1;
***** * * ** *** * * * *** ** * * ** *** if(k == strlen(b))
** * ** ***** ** * * ***** *** ** ****
* * * ********* * ** * **** *** ***** **** * ** * *
* *** * * *** * *** **** * ******* * * = 0;
* * * * * *** *** * *** ** * * ******* ** ** * ***
** ** *** * * * ** ***** **** * **
* * * **** * ** * *** ** * *
* * *** ** ** ***** ** **** == strlen(b))
* * * * * * * ***** * ** *******
* * **** **** ** *
* ** **** ** *** * * ** == 0)
* * * ** *** **** * *** *** * are no %c%s%c in * * * * ***
**** ** ****** * * * if(k == strlen(b))
** * **** * *** ** ** * *** * * * is %c%s%c in * * ** *** **
return 0;
}
answered
Jan 4, 2017
by
Doloa
(
-122
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>
int main()
{
* * * * * *** * * * a[100],b[100];
* * * ** * * ** ** * * la,lb,i,j,n=0;
*** ** * * **** * ** * *** *** * **
** ** ** * *** *** * = strlen(a);
****** ****** * * * **** = strlen(b);
** * * * * * * *** *** * * *
* ** * * * ** *** ** *
** * * * ** * *** *** * *** *** ** * * * * ** && a[i]<='Z')
* *** *** * ** ******** *** **** * ** * * **** * ** * * * *** * = a[i]+32;
* * ** ***** * * *
**** * * * * ** *** * * ***
*** * *** * *** *
* ** * *** * * ** ** ***** ** ***** **** **** ** * && b[i]<='Z')
*** **** * *** *** * ** * * * ** ** * ** * * ***** *** * * * ** * * * = b[i]+32;
* ***** ** ** ** **
** ** ** * * ** ** *** *** ****
{
*** *** * ***** ** ** * * * * *** * * * * **
*** * * ** ** * ***** ** ** * *** *** *** * * ***** **
* * ** **** * * ** * * * * ** ** ** ** * * * **
*** * ** ** * * * * **** * * ** * * ** ** * (a[i]==b[j])
*** ******** *** * * ** *** * * * *** * * ** * * ** * **** * **** * ** ***
* *** * ** *** ** * * *** * * *** * ** *** * ***** * *** * ** *
** *** ** ** * ** * ** ** *** ********
* *** ** ***** ******* *** **** ** *** ** ** * *
** * * * * ** * ******** * ** * ******** * ***** * * *** * * ** * * **** is "%s" in "%s"\n",b,a);
* ** * ** * * ** ***** *** ** * ***
** *** * ** * * **** * ** ** ***** ** * ******** * *** ** * ***** ** * is no "%s" in "%s"\n",b,a);
}
***** ***** ** ** **** *** 0;
}
answered
Jan 3, 2017
by
410323020
(
-85
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include * ** ** * *
#include *** *** *
#include <ctype.h>
void test(char *t1,char *t2);
int main ()
{
* * ** ** * *** *** ** s1[30],s2[30];
* * ** * ** * * * ****** * * * * ** * != EOF)
* * * * * ** * * ** ** ** * ** * *** *** ***** * **** != EOF)
***** * *** ** * ** ** ** * * **** ** * * ** ** ******* * * * * ** ** *
}
void test(char *t1,char *t2)
{
** ******* ** *** * * ** * b1[30],b2[30];
* ** * * * *** ** i ;
**** ** *** * ** ** ** (i=0; i<30; i++)
* * * *** * * **
** * ** ** * ** ** * ** ** * *** ** ***** *** **** *
* **** * **** * ** *** * * ** ** **** ** *** *
*** *** * ** **
* **** ** * ** ** * (i=0; i<30; i++)
* ** * * ** ** * * * **
*** * ** *** * ****** ***** ** ***** ** * * * = toupper(t1[i]);
** *** * ***** * * * * * ** *** *** *** **** *** = toupper(t2[i]);
** ** *** * * *** ** **
******** * ** ** c=(34);
*** ***** * *** * *** *loc = strstr(t1,t2);
*** ** * * ** *** * * ** == NULL)
* * * * ** * *** ** ***** * * **** * ** * * * are no %c%s%c in *** *** * * * **
** * **** * * * **
* *** ** ** * ** * * ** * *** ** * ** *** * * is %c%s%c in * * * *** ** **
}
answered
Jan 3, 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 ** ****
void test(char *t1,char *t2);
int main ()
{
* * ** * * * ** ** ** * s1[30],s2[30];
** ** * **** * * * * **** * ** * != EOF)
** * * * ** * ** ** ******* ** * * ** ** * **** * *** != EOF)
** * * * * ** * * * ** * * * ***** ** ** * * ** *** * * * *** ********
}
void test(char *t1,char *t2)
{
* ** * * *** * * ** **** * b1[30],b2[30];
* *** *** *** * * * * ** i ;
** * ** **** * * **** * (i=0; i<30; i++)
* * ** *** * *
* * * * ** * ** * * * *** * * * * * ** * ** * *
* * ** ** ** ** * ***** * *** * * ******* * ** **
* ** ** * * ** * ***
* * * ** * * * ** (i=0; i<30; i++)
* **** **** * ** * *****
* * * * *** ** * *** ** *** ** ******* * * = toupper(t1[i]);
***** * * *** **** *** * * * ** * *** *** * * = toupper(t2[i]);
* * **** *** **** ***
* ** *** * **** c=(34);
* * **** * ***** ** * * *loc = strstr(t1,t2);
***** * * *** * *** * == NULL)
*** * ** ** * * * ***** * **** * ***** **** * ** * * are no %c%s%c in ***** ** ****
* ****** *** * * ** ***
** *** * * * **** * *** ** * *** * * *** *** ** ** * * is %c%s%c in * ** * * * * * **
}
answered
Jan 3, 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 * * * * *
void test(char *t1,char *t2);
int main ()
{
* * ***** ** ** * s1[10],s2[10];
****** * * ** * ***** * * * *** *** != EOF)
**** * ** *** ** * * ****** **** * **** * * ** *** ** * * * != EOF)
** ** ** ** *** * ** *** **** * **** * * ** ***** * * ** * ** * * *
}
void test(char *t1,char *t2)
{
* * ****** * ** * c=(34);
* * ** * * ***** ** *loc = strstr(t1,t2);
**** * *** ** ****** ** * * == NULL)
** * * * ** * * * * *
* * * ** * * ** * *** ***** **** ***** * * * ** is %c%s%c in ** * ** *
* ****** **** ** * ****
***** * **** ** ** *** * * *
* * ** * * ****
* ** * * *** ******* ** *** * ** * ****** ** are no %c%s%c 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 ** ** * * *** *
void test(char *t1,char *t2);
int main ()
{
** ** * * *** ** *** ** s1[10],s2[10];
*** ** * ** * * ** * * * **** * != EOF)
* * *** ** * * * * *** * **** *** ** * ** * *** != EOF)
*** * ******* * ** *** * *** *** * ** ** ** * * ** * * * ** * ** * * *
}
void test(char *t1,char *t2)
{
* * * * * * *** *loc = strstr(t1,t2);
* ***** * **** * == NULL)
* * * * ** ** *
* * **** ** * **** * ** * *** * * ** * *** * *** ** is %s in %s",t2,t1);
** ** * * *** * * * * **
* * *** * *** ** * * **
*** * *** **** *
* *** **** * * *** * * * * * *** * ** * * 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.
Page:
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.179.46
©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.5k
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