0 like 0 dislike
6.4k views
翻譯的工作有時候是依翻譯的字數來計價的,請設計一個程式計算一個句子中有幾個單字,在一個句子中被標點符號或是泛白字元隔開的可視為一個單子。

輸入說明:輸入會包含英文字母、數字以及標點符號,當程式遇到句點(.)時代表輸入結束。

輸出說明:請輸出一個整數代表輸 入的句子當中包含幾個單字。

輸入範例:

According to Josephus' account of the siege of Yodfat, he and his 40 soldiers were trapped in a cave by Roman soldiers.

輸出範例:

22
[Exercise] Coding (C) - asked in 2016-1 程式設計(一)AC by (18k points)
ID: 18071 - Available when: 2016-12-01 18:30:00 - Due to: 2016-12-01 21:00:00

reshown by | 6.4k views
0 0
Called for Help

86 Answers

0 like 0 dislike
Hidden content!
//  Created by HoMingJui on 2016/11/3.

//



#include <stdio.h>

#include ****** *

#include <ctype.h>





int main(){
***** * * * * ** *** * ** a,t=0;
** **** *** ***** * * ******* ** * **** * *
* * ** **** * * * * * * !='.'){
*** * * *** ** * *** * ** * * ** ** * * * **** **** **
* **** * * ** ** ****** ***** ** * * *** * * * ** **
* *** * ** *** ** * *** * ** *** * ** ** ** **
* ****** ** * * ** * ** * * ** ** * * * ** ** * *** **
** *** ** ** ** * ***
* ** *** * * ** **** * ******* *****
**** ** * * ** * ** ** ** 0;

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

#include <ctype.h>



int check(char c)

{

    int i;
******* ** * * * ** ** * ***
*** * * **** * * * ** * * ** *
* * * * ** ** * ** *** *** ** * * ** *** *
************* ** * **** * i;

}



int check2(char c)

{

    int j;
*** * ****** * * *
******** * ** * ** ** * ** * * *
** ** * ** ** ** ** * * * * * * * *
*** * * * * **** *** ** j;

}





int main ( void )

{

    char c ;

    int l,i,j;
** *** * * *** *** ** * * ** * * ** *

    l=0;
*** * ***** ** *
* ** *** * * * * * * ****


* * * * ** * * * != '.')

    {
*** ** * * * ***** ** * * * *** **** * * *** *
* * * * ** *** ** ** *** ** ** ** ** * *


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


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


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

    }


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






* ** ** ***** * ** ** * ** 0;

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

#include <ctype.h>



int check(char c)

{

    int i;
*** * *** ***** * ** ** **
* ****** * * ** ** * * **** * *
* * *** * *** * ** * * * *** * **** * ** * ***
* * **** * * **** * * ** i;

}



int check2(char c)

{

    int j;
** *** **** ** * ** *
* * ** ** *** ***
* * ** * * ** ** * ***** ** **** ** **** *
* ** ** *** * ** * ** * * j;

}





int main ( void )

{

    char c ;

    int l,i,j;
** ** ** * ** * ** * * *** ** *** * ****
*** **** *** ** * * **
* ** * * * * ** * *
* *** * * * * ** ** * *


* **** ** * **** ** * != '.')

    {
* ** *** * *** * * *** * * ** * * **
*** *** *** * * * * ** * * ******* * ***** ** *


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


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


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

    }



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






*** ** ** * * ** ** * 0;

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

#include <ctype.h>



int check(char c)

{

    int i;
** * ** * * *** *
* * * * **** ** * ** *** * * *
* *** * * **** ** ** ** *** * * * * *
** * ** * ** ** i;

}



int check2(char c)

{

    int j;
** **** *** ****** * ** *** **
* ** * *** * *
* * ** * *** ** * ****** ** * * * ***
* * * ** ** *** * j;

}





int main ( void )

{

    char c ;

    int l,i,j;
** * **** * ** ** ****** **** * ** *

    l=0;
* ** ** ** ** *** * ** **
*** ** * * * * ** **


** * ** * ** ** ** != '.')

    {
* *** ** * ** ** * *** * ****** *
**** * * * * * ** * *** ***** * * * * **


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


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


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

    }


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






* * *** *** ** * ** ** * 0;

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

#include ****** * * * *

#include <math.h>

#include <ctype.h>

int check1(char c)

{
* * * ** * * * i=0;
** *********** ****** **** * * ** * **** *
* ** * ** ** * ***** * ** * * * *** * **** ***
* * * ** * ** * * ** * * * i;

}





int main()

{
**** * * * * **** ** * c;
***** ** ** * * ** i=0;
* * * * ** * * * ***** * * * * * **
** * **** *** * c!='.')
* ** ** *** **** * ******


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



return 0;

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

#include <stdlib.h>



int main()

{
* ** * ** * * * * a[10000];
* * * * *** * * * * q=0,n=0;
* * * ** * *** ****** ******
* *** ** * ** ** * ** ** (a[n]!='\0')
******* * * * ** * * *
* * * ** ** * * * *** **** * * * * * * * ')
**** ** * * * *** *** * **** * * ** **** ** * *** ** * = q + 1;
** **** * * * * * * ** **** ****** * *** ** if(a[n]=='.')
** * * * ***************** * * ** * * ** * * * * *** * ******* *** * = q + 1;
*** *** ** * ****** ** ** ** *** * ** = n+1;
** ******* *** **
* * ********* * * * **** *** *
* ** ***** *** ** * * * 0;

}
answered by (-85 points)
0 like 0 dislike
Hidden content!
//  Created by HoMingJui on 2016/11/3.

//



#include <stdio.h>

#include ** **** * * *

#include <ctype.h>





int main(){
****** * * *** *** *** **** a,t=0;
* *** ** *** * **** ** ** * ******* * ******
* ** *** *** **** * ** !='.'){
*** ** ** **** *** * * ***** ** * * ** * ** **
* *** * * ***** ** ** * ** * * *** * * * **** * * **** *** ** * ****** *
** ** * ****** * ** * ****** ** * * **** * * **
****** * ** ** *** **** *** **** * * * * * * ** ** * ****** ** * *
* **** **** * *** * **
* * * * * ** *** *** * ** * * * **
***** * *** * ** * * ** 0;

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

# include * * ** **** ***  

int n;

void check (char c);

int main ()

{
* ** ** *
*** * *** *** ** **** c;
* * * ** *** *
***** * * ** *** * ( * **** ** * ** * ** );
* * ** * ** **** * * ( c!= '.' )

* ** **** ****
* * * * ************ * ** (c);
* ** **** * ** ** * * * * ( **** ** * );
*** * *** * * **
* ** * ** **
* * * *** ** ** * * ** **
* ** * ** * * ** 0;

}

void check (char c)

{
* * ** * * ** * (isspace(c))
** ***** *****
* * ** ** * * *** ****
******* ** ** **
** *** * * **** ** ******

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

# include <ctype.h>



 int main()

 {
* * * * ** ** *** * ** * * * c;


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


** * * ** ** * * ** * ** * * * * **** &c);
* * ***** * * * * ** * * ** c != '.')
* *** *** ** * ** *
** ** **** * ** ** ** * *** * *** ** * ** * * * * *






* * *** * * **** * * **** *** ** ***** ** * += 1;


*** ** **** *** * ***** ** *** ** ***** *** * * * ** * ** ***** * &c);
* * ** ** ** ** ** * ** * *** ** **** **** * *
***** ** ****** * * *** **** ** * *** * ** ** * *


** ** *** * ** * * * *** ** i);


** * ****** * ** * * 0;



}
answered by (-120 points)
0 like 0 dislike
Hidden content!
//  Created by HoMingJui on 2016/11/3.

//



#include *** **

#include * * ** ** * *

#include ** ** * *





int main(){
*** ** * ** * ** ** * a,t=0;
*** * * ** * ** * ****** * * * * ***
**** ** **** *** ** * ** * *** !='.'){
***** ** * * *** * * * * ** * *** * **** * **
** * * * **** *** ** * ******* **** ** **** **** **** **** * **
** * *** ** ** ** *** **
**** **** ** ** ****** * * ****** *** *** *
* ** * ** * * * * ** ** 0;

}
answered by (-126 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.71.255.22
©2016-2025

Related questions

0 like 0 dislike
16 answers
[Exercise] Coding (C) - asked Dec 1, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points)
ID: 18075 - Available when: 2016-12-01 18:30:00 - Due to: 2016-12-01 21:00:00
| 2.1k views
0 like 0 dislike
49 answers
[Exercise] Coding (C) - asked Dec 1, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points)
ID: 18070 - Available when: Unlimited - Due to: Unlimited
| 3.7k views
0 like 0 dislike
62 answers
[Exercise] Coding (C) - asked Dec 1, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points)
ID: 18067 - Available when: 2016-12-01 18:30:00 - Due to: 2016-12-01 21:00:00
| 5.1k views
0 like 0 dislike
21 answers
[Exercise] Coding (C) - asked Dec 1, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points)
ID: 18066 - Available when: 2016-12-01 18:30:00 - Due to: 2016-12-01 21:00:00
| 2.2k views
0 like 0 dislike
0 answers
[Resource] asked Dec 1, 2016 in 2016-1 程式設計(一)AC by Shun-Po (18k points)
ID: 18085 - Available when: Unlimited - Due to: Unlimited
| 10 views
12,783 questions
183,442 answers
172,219 comments
4,824 users