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

input:

Hello, how are you?

output:

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

reshown by | 114 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:172.69.63.142
©2016-2021

Related questions

0 like 0 dislike
31 answers
[Normal] Coding (C) - asked Jan 3, 2017 in 2016-1 程式設計(一)AC
ID: 20482 - Available when: Unlimited - Due to: Unlimited
| 383 views
0 like 0 dislike
24 answers
asked Dec 7, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points) | 234 views
0 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 5, 2017 in 2016-1 程式設計(一)AC
ID: 20997 - Available when: Unlimited - Due to: Unlimited
| 93 views
0 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2017 in 2016-1 程式設計(一)AC by 410425014 (-162 points)
ID: 20514 - Available when: Unlimited - Due to: Unlimited
| 111 views
0 like 0 dislike
5 answers
[Normal] Coding (C) - asked Dec 27, 2016 in 2016-1 程式設計(一)AC by 410342026 (-105 points)
ID: 20135 - Available when: Unlimited - Due to: Unlimited
| 124 views
11,518 questions
143,866 answers
148,143 comments
4,159 users