1 like 0 dislike

(20%)由於經濟不景氣,張三決定改行當個占卜師。但張三對於占卜術還不太上手,非常苦惱。請幫他設計一個程式如下:

請輸入一個日期,然後依照下面的公式:

M=月
D=日
S=(M*2+D)%3

得到 S 的值,再依照 S 的值從 0 到 2 分別給與 小吉(small)、中吉(medium)、大吉(big) 等三種不同的運勢。

input:

1 1

output:

small

 

[Exam] asked in 2017-1 程式設計(一)AD by (30k points)
Available when: 2018-01-19 18:30 - Due to: 2018-01-19 21:30

edited by | 316 views

21 Answers

0 like 0 dislike
Hidden content!
#include<stdio.h>

int main()
{
* * * * * ** * ** * m,d,s;
** ** * * ** * ** ** ** %d",&m,&d);
** *** ** * * ******
*** * *** * * * * * **** * ** ** *
** ** * ** ** * ** *
** * * * ***** * * * **** ************** ** * *
* *** * * * * *** * ** **
** * * * * * ** ** *** ** * * ** ****
* * *** * * * * ****** ***
**** * * ** ** ** ** ** * * ***** ** * * * *
**** ** * * ** * * *** *
   
}
answered by (192 points)
edited by
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
-----------Re-judge-----------
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 0
-----------Re-judge-----------
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:173.245.54.81
©2016-2020

Related questions

1 like 0 dislike
24 answers
[Exam] asked Jan 19, 2018 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
Available when: 2018-01-19 18:30 - Due to: 2018-01-19 21:30
| 191 views
1 like 0 dislike
24 answers
[Exam] asked Jan 19, 2018 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
Available when: 2018-01-19 18:30 - Due to: 2018-01-19 21:30
| 213 views
1 like 0 dislike
24 answers
[Exam] asked Jan 19, 2018 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
Available when: 2018-01-19 18:30 - Due to: 2018-01-19 21:30
| 205 views
2 like 0 dislike
24 answers
[Exam] asked Jan 19, 2018 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
Available when: 2018-01-19 18:30 - Due to: 2018-01-19 21:30
| 141 views
1 like 0 dislike
23 answers
[Exam] asked Jan 19, 2018 in 2017-1 程式設計(一)AD by 楊修俊 (30k points)
Available when: 2018-01-19 18:30 - Due to: 2018-01-19 21:30
| 125 views
10,159 questions
107,549 answers
92,558 comments
3,255 users