0 like 0 dislike
請設計一個程式,試計算輸入字串的長度。

input:

Hello, how are you?

output:

19
[Normal] Coding (C) - asked in 2016-1 程式設計(一)AC by (-85 points)
Available when: Unlimited - Due to: Unlimited

reshown by | 37 views

7 Answers

0 like 0 dislike
Best answer
Hidden content!
*** ***** ** *
* * *** ****



int main()

{
* ** *** *** *


** ** * *
* **** * *** * ** *** ** ** *** );
* * * * *** 0;

}
answered by (-85 points)
selected by
0 like 0 dislike
Hidden content!
#include <stdio.h>

#define MAXLEN 10000

int getStr(char line[], int nmax);

int main(void){
**** ** * * ** *** *** strLen;
** ** * * * **** *** buffer[MAXLEN+1];
* *** ** * ***** * **
** * ** ** *** ** *** * * * * ** ** * ** **** * ** = getStr(buffer, MAXLEN);
****** **** *** * **** * *** ** *** ** (strLen==0)
* * *** * * *** * * ** ** ***** ***** * **** * ** * * *
* ** ** *** * * * * ** ** * * * * * ** * * ** *** * * * *** ** *
** ** * * **** ** ** * **

}

int getStr(char *buffer, int maxLen){
* ****** ** ******* * * ** c;
* * *** * ***** len = 0;
* * * * ** ** *** * *** ** (c=getchar()) != '\n' ){
* **** * ** * ** ** ** * *** * *** * **** * * *
* * * ** * * *** * * *** ** * * ** * **** ** ** ** * * ** *
*** * ********* * *** * * * **** * * * * * * **** * * * * * ** **
** * *** ** * * * ** *** ** * ** ** * *

    }
*** * * * *** * *** * * ** **
* * * * * *** **** ** * *** ** ****
*** * * *** ** * len;

}
answered by (-100 points)
0 like 0 dislike
Hidden content!
*** ** * * **
* * ** * * *



int *


** * * * * ** * i = 0,k = 0,a = 0;






**** * * *** * * * != '\n'){
* * * *** * = * **
* **** * * * ** ++;
* **** *


* *** * ** * * ***** ******* * k-1);


* * * * ** 0;

}
answered by (-122 points)
0 like 0 dislike
Hidden content!
#include * ** * * *

#include ****** * *



int ****


** ** * **** * ** a[5000];
* *** * * ***** i = 0;


**** ** **** *** ** ** * * *


** *** * * *** * *** * *** *


*** ** 0;

}
answered by (-122 points)
0 like 0 dislike
Hidden content!
* * * * * * * * *
* * * *
** ** * *******
*** ** *** * **



int main()

{
* * * ** **** * a[500];
*** ** ***** * * ** * * **** * *
* * ** *** *** ** * *** * * ** **** * ** ***** ;    
*** ** **** ** * **** * * * 0;

}
answered by (-102 points)
0 like 0 dislike
Hidden content!
* * *** ******
**** * ** ** * * ** *
** *** * *******
* * ** * * **
* ** *** ** ** *



int * ** * * *

{


* ** * * * char s[1000];


***** * ** * gets(s);


**** ** ** *** * ** ** *** * * ** *


** ** ** return 0;



}
answered by (-157 points)
0 like 0 dislike
Hidden content!
**** * ***** ******* *
* * * *** * * *
** * **** * ** *
* * * ***** **** **
** * * * *** ** ** *



int ** ** ** **

{


****** ** ** char s[1000];


* * gets(s);


* ** **** * * *** * * * ***


* ** * *** return 0;



}
answered by (-157 points)
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.158.78.130
©2016-2019

Related questions

0 like 0 dislike
31 answers
[Normal] Coding (C) - asked Jan 3, 2017 in 2016-1 程式設計(一)AC
Available when: Unlimited - Due to: Unlimited
| 108 views
0 like 0 dislike
24 answers
asked Dec 7, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points) | 84 views
0 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 5, 2017 in 2016-1 程式設計(一)AC
Available when: Unlimited - Due to: Unlimited
| 35 views
0 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2017 in 2016-1 程式設計(一)AC by 410425014 (-162 points)
Available when: Unlimited - Due to: Unlimited
| 49 views
0 like 0 dislike
5 answers
[Normal] Coding (C) - asked Dec 27, 2016 in 2016-1 程式設計(一)AC by 410342026 (-105 points)
Available when: Unlimited - Due to: Unlimited
| 43 views
8,201 questions
63,042 answers
35,691 comments
1,343 users