herrDeng網內搜尋

自訂搜尋

Ads

2017年10月11日 星期三

Ex3 C++作業「13個星座」



NASA認為現在的天宮圖與3000年前不同,現在的地球軸心位置改變,星座也發生移位,所以他們決定加入「蛇夫座」。

輸入月、日,輸出所屬的13個星座。






但消息傳出後,引起星座迷討論,時尚雜誌《Cosmopolitan》稱NASA重新改寫了星座曆,指NASA把人們遺忘的第13個星座「蛇夫座」翻出。
不過NASA強調,因為地球軸心變動,12星座已經改變,但原本的星座並沒有錯,而且他們研究的是天文學,和占星學無關,占星不是科學也不是天文學,他們並沒有改變星座圖的任何內容,僅僅是做數學演算,所以12星座還是12星座。

圖取自NASA tumblr網頁

《COSMOPOLITAN》雜誌中報導,有關13個星座的分佈:
魔羯座: 1月21日 – 2月16日
水瓶座: 2月17日 – 3月11日
雙魚座: 3月12日– 4月18日
白羊座: 4月19日 – 5月13日
金牛座: 5月14日 – 6月21日
雙子座: 6月22日 – 7月20日
巨蟹座: 7月21日 – 8月10日
獅子座: 8月11日 – 9月15日
處女座: 9月16日 – 10月30日
天秤座: 10月31日 – 11月23日
天蠍座: 11月24日 – 11月29日
蛇夫座: 11月30日– 12月17日
人馬座: 12月18日 – 1月20日

資料來源:http://news.ltn.com.tw/news/life/breakingnews/1842639

58 則留言:

B10533004 李登恩 提到...

#include <string>
#include <iostream>
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10433065劉勝威 提到...

#include<iostream>

using namespace std;

int main(){
int m,d,day_code;
cout << "請輸入月份:" ;
cin >> m ;
cout << "請輸入日期:" ;
cin >> d ;

day_code = m*100+d;

string h[14]={"無此星座","魔羯座","水瓶座","雙魚座","白羊座","金牛座","雙子座",
"巨蟹座","獅子座","處女座","天秤座","天蠍座","蛇夫座","人馬座"};

switch(m){

case 1:
if(day_code<121){
cout << h[13];
}else
cout << h[1];
break;
case 2:
if(day_code>=217){
cout << h[2];
}else{
cout << h[1];
}
break;
case 3:
if(day_code>=312){
cout << h[3];
}else{
cout << h[2];
}
break;
case 4:
if(day_code>=419){
cout << h[4];
}else{
cout << h[3];
}
break;
case 5:
if(day_code>=514){
cout << h[5];
}else{
cout << h[4];
}
break;
case 6:
if(day_code>=622){
cout << h[6];
}else{
cout << h[5];
}
break;
case 7:
if(day_code>=721){
cout << h[7];
}else{
cout << h[6];
}
break;
case 8:
if(day_code>=811){
cout << h[8];
}else{
cout << h[7];
}
break;
case 9:
if(day_code>=916){
cout << h[9];
}else{
cout << h[8];
}
break;
case 10:
if(day_code>=1031){
cout << h[10];
}else{
cout << h[9];
}
break;
case 11:
if(day_code>=1124&&day_code<1130){
cout << h[11];
}else if(day_code>=1130){
cout << h[12];
}else{
cout << h[10];
}
break;
case 12:
if(day_code>=1130&&day_code<1218){
cout << h[12];
}else{
cout << h[13];
}
break;
default:
cout << h[0];
}
}

B10533062 洪尚郁 提到...

#include <string>
#include <iostream>
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10433065劉勝威 提到...

#include<iostream>

using namespace std;

int main(){
int m,d,day_code;
cout << "請輸入月份:" ;
cin >> m ;
cout << "請輸入日期:" ;
cin >> d ;

day_code = m*100+d;

string h[14]={"無此星座","魔羯座","水瓶座","雙魚座","白羊座","金牛座","雙子座",
"巨蟹座","獅子座","處女座","天秤座","天蠍座","蛇夫座","人馬座"};

switch(m){

case 1:
if(day_code<121){
cout << h[13];
}else
cout << h[1];
break;
case 2:
if(day_code>=217){
cout << h[2];
}else{
cout << h[1];
}
break;
case 3:
if(day_code>=312){
cout << h[3];
}else{
cout << h[2];
}
break;
case 4:
if(day_code>=419){
cout << h[4];
}else{
cout << h[3];
}
break;
case 5:
if(day_code>=514){
cout << h[5];
}else{
cout << h[4];
}
break;
case 6:
if(day_code>=622){
cout << h[6];
}else{
cout << h[5];
}
break;
case 7:
if(day_code>=721){
cout << h[7];
}else{
cout << h[6];
}
break;
case 8:
if(day_code>=811){
cout << h[8];
}else{
cout << h[7];
}
break;
case 9:
if(day_code>=916){
cout << h[9];
}else{
cout << h[8];
}
break;
case 10:
if(day_code>=1031){
cout << h[10];
}else{
cout << h[9];
}
break;
case 11:
if(day_code>=1124&&day_code<1130){
cout << h[11];
}else if(day_code>=1130){
cout << h[12];
}else{
cout << h[10];
}
break;
case 12:
if(day_code>=1130&&day_code<1218){
cout << h[12];
}else{
cout << h[13];
}
break;
default:
cout << h[0];
}
}

B10533015 陳建志 提到...

#include <string>
#include <iostream>
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10433065劉勝威 提到...

switch(m){

case 1:
if(day_code<121){
cout << h[13];
}else
cout << h[1];
break;
case 2:
if(day_code>=217){
cout << h[2];
}else{
cout << h[1];
}
break;
case 3:
if(day_code>=312){
cout << h[3];
}else{
cout << h[2];
}
break;
case 4:
if(day_code>=419){
cout << h[4];
}else{
cout << h[3];
}
break;
case 5:
if(day_code>=514){
cout << h[5];
}else{
cout << h[4];
}
break;
case 6:
if(day_code>=622){
cout << h[6];
}else{
cout << h[5];
}
break;
case 7:
if(day_code>=721){
cout << h[7];
}else{
cout << h[6];
}
break;
case 8:
if(day_code>=811){
cout << h[8];
}else{
cout << h[7];
}
break;
case 9:
if(day_code>=916){
cout << h[9];
}else{
cout << h[8];
}
break;
case 10:
if(day_code>=1031){
cout << h[10];
}else{
cout << h[9];
}
break;
case 11:
if(day_code>=1124&&day_code<1130){
cout << h[11];
}else if(day_code>=1130){
cout << h[12];
}else{
cout << h[10];
}
break;
case 12:
if(day_code>=1130&&day_code<1218){
cout << h[12];
}else{
cout << h[13];
}
break;
default:
cout << h[0];
}

B10433073何明宗 提到...

switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

B10433106簡瑋佑 提到...

switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

B10433072廖翊翔 提到...

switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

B10433102楊婷妤 提到...

switch(m){

case 1:
if(day_code<121){
cout << h[13];
}else
cout << h[1];
break;
case 2:
if(day_code>=217){
cout << h[2];
}else{
cout << h[1];
}
break;
case 3:
if(day_code>=312){
cout << h[3];
}else{
cout << h[2];
}
break;
case 4:
if(day_code>=419){
cout << h[4];
}else{
cout << h[3];
}
break;
case 5:
if(day_code>=514){
cout << h[5];
}else{
cout << h[4];
}
break;
case 6:
if(day_code>=622){
cout << h[6];
}else{
cout << h[5];
}
break;
case 7:
if(day_code>=721){
cout << h[7];
}else{
cout << h[6];
}
break;
case 8:
if(day_code>=811){
cout << h[8];
}else{
cout << h[7];
}
break;
case 9:
if(day_code>=916){
cout << h[9];
}else{
cout << h[8];
}
break;
case 10:
if(day_code>=1031){
cout << h[10];
}else{
cout << h[9];
}
break;
case 11:
if(day_code>=1124&&day_code<1130){
cout << h[11];
}else if(day_code>=1130){
cout << h[12];
}else{
cout << h[10];
}
break;
case 12:
if(day_code>=1130&&day_code<1218){
cout << h[12];
}else{
cout << h[13];
}
break;
default:
cout << h[0];
}

B10433081巫明芬 提到...

switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

B10433094 簡筱芸 提到...

switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

b10533037 張俊為 提到...

switch(m){

case 1:
if(day_code<121){
cout << h[13];
}else
cout << h[1];
break;
case 2:
if(day_code>=217){
cout << h[2];
}else{
cout << h[1];
}
break;
case 3:
if(day_code>=312){
cout << h[3];
}else{
cout << h[2];
}
break;
case 4:
if(day_code>=419){
cout << h[4];
}else{
cout << h[3];
}
break;
case 5:
if(day_code>=514){
cout << h[5];
}else{
cout << h[4];
}
break;
case 6:
if(day_code>=622){
cout << h[6];
}else{
cout << h[5];
}
break;
case 7:
if(day_code>=721){
cout << h[7];
}else{
cout << h[6];
}
break;
case 8:
if(day_code>=811){
cout << h[8];
}else{
cout << h[7];
}
break;
case 9:
if(day_code>=916){
cout << h[9];
}else{
cout << h[8];
}
break;
case 10:
if(day_code>=1031){
cout << h[10];
}else{
cout << h[9];
}
break;
case 11:
if(day_code>=1124&&day_code<1130){
cout << h[11];
}else if(day_code>=1130){
cout << h[12];
}else{
cout << h[10];
}
break;
case 12:
if(day_code>=1130&&day_code<1218){
cout << h[12];
}else{
cout << h[13];
}
break;
default:
cout << h[0];
}

b10533004 李登恩 提到...

switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533062 洪尚郁 提到...

switch(m){
case 1 :
if (day_code<121)n=13;
else n=1;
break ;
case 2 :
if (day_code<217)n=1;
else n=2;
break ;
case 3 :
if (day_code<312)n=2;
else n=3;
break ;
case 4 :
if (day_code<419)n=3;
else n=4;
break ;
case 5 :
if (day_code<514)n=4;
else n=5;
break ;
case 6 :
if (day_code<622)n=5;
else n=6;
break ;
case 7 :
if (day_code<721)n=6;
else n=7;
break ;
case 8 :
if (day_code<811)n=7;
else n=8;
break ;
case 9 :
if (day_code<916)n=8;
else n=9;
break ;
case 10 :
if (day_code<1031)n=9;
else n=10;
break ;
case 11 :
if (day_code<1124)n=10;
else if(day_code<1130) n=11 ;
else n=12;
break ;
case 12 :
if (day_code<1218)n=12;
else n=13;
break ;
default :
n=0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533018陳郁傑 提到...

switch(m){
case 1 :
if (day_code<121)n=13;
else n=1;
break ;
case 2 :
if (day_code<217)n=1;
else n=2;
break ;
case 3 :
if (day_code<312)n=2;
else n=3;
break ;
case 4 :
if (day_code<419)n=3;
else n=4;
break ;
case 5 :
if (day_code<514)n=4;
else n=5;
break ;
case 6 :
if (day_code<622)n=5;
else n=6;
break ;
case 7 :
if (day_code<721)n=6;
else n=7;
break ;
case 8 :
if (day_code<811)n=7;
else n=8;
break ;
case 9 :
if (day_code<916)n=8;
else n=9;
break ;
case 10 :
if (day_code<1031)n=9;
else n=10;
break ;
case 11 :
if (day_code<1124)n=10;
else if(day_code<1130) n=11 ;
else n=12;
break ;
case 12 :
if (day_code<1218)n=12;
else n=13;
break ;
default :
n=0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533017古峻衛 提到...

#include

using namespace std;

int main(){
int m,d,day_code;
cout << "請輸入月份:" ;
cin >> m ;
cout << "請輸入日期:" ;
cin >> d ;

day_code = m*100+d;

string h[14]={"無此星座","魔羯座","水瓶座","雙魚座","白羊座","金牛座","雙子座",
"巨蟹座","獅子座","處女座","天秤座","天蠍座","蛇夫座","人馬座"};

switch(m){

case 1:
if(day_code<121){
cout << h[13];
}else
cout << h[1];
break;
case 2:
if(day_code>=217){
cout << h[2];
}else{
cout << h[1];
}
break;
case 3:
if(day_code>=312){
cout << h[3];
}else{
cout << h[2];
}
break;
case 4:
if(day_code>=419){
cout << h[4];
}else{
cout << h[3];
}
break;
case 5:
if(day_code>=514){
cout << h[5];
}else{
cout << h[4];
}
break;
case 6:
if(day_code>=622){
cout << h[6];
}else{
cout << h[5];
}
break;
case 7:
if(day_code>=721){
cout << h[7];
}else{
cout << h[6];
}
break;
case 8:
if(day_code>=811){
cout << h[8];
}else{
cout << h[7];
}
break;
case 9:
if(day_code>=916){
cout << h[9];
}else{
cout << h[8];
}
break;
case 10:
if(day_code>=1031){
cout << h[10];
}else{
cout << h[9];
}
break;
case 11:
if(day_code>=1124&&day_code<1130){
cout << h[11];
}else if(day_code>=1130){
cout << h[12];
}else{
cout << h[10];
}
break;
case 12:
if(day_code>=1130&&day_code<1218){
cout << h[12];
}else{
cout << h[13];
}
break;
default:
cout << h[0];
}
}

B10533011 江道逸 提到...

switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

b10533018陳郁傑 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "摩羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";

int m = 0;
int d = 0;
cout<<"輸入月份:";
cin>>m;
cout<<"輸入日期:";
cin>>d;
int day_code =0;
day_code = ((100*m)+d);
int n =0;
switch(m){
case 1 :
if (day_code<121)n=13;
else n=1;
break ;
case 2 :
if (day_code<217)n=1;
else n=2;
break ;
case 3 :
if (day_code<312)n=2;
else n=3;
break ;
case 4 :
if (day_code<419)n=3;
else n=4;
break ;
case 5 :
if (day_code<514)n=4;
else n=5;
break ;
case 6 :
if (day_code<622)n=5;
else n=6;
break ;
case 7 :
if (day_code<721)n=6;
else n=7;
break ;
case 8 :
if (day_code<811)n=7;
else n=8;
break ;
case 9 :
if (day_code<916)n=8;
else n=9;
break ;
case 10 :
if (day_code<1031)n=9;
else n=10;
break ;
case 11 :
if (day_code<1124)n=10;
else if(day_code<1130) n=11 ;
else n=12;
break ;
case 12 :
if (day_code<1218)n=12;
else n=13;
break ;
default :
n=0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533037 張俊為 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533076 姜國傑 提到...

#include
#include
using namespace std;
int main(int argc, char** argv) {
string hor[14];
hor[0] = "無此星座";
hor[1] = "摩羯座";
hor[2] = "水瓶座";
hor[3] = "雙魚座";
hor[4] = "牡羊座";
hor[5] = "金牛座";
hor[6] = "雙子座";
hor[7] = "巨蟹座";
hor[8] = "獅子座";
hor[9] = "處女座";
hor[10] = "天秤座";
hor[11] = "天蠍座";
hor[12] = "蛇夫座";
hor[13] = "射手座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day = 0;
day = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

B10533076 姜國傑 提到...

#include
#include
using namespace std;
int main(int argc, char** argv) {
string hor[14];
hor[0] = "無此星座";
hor[1] = "摩羯座";
hor[2] = "水瓶座";
hor[3] = "雙魚座";
hor[4] = "牡羊座";
hor[5] = "金牛座";
hor[6] = "雙子座";
hor[7] = "巨蟹座";
hor[8] = "獅子座";
hor[9] = "處女座";
hor[10] = "天秤座";
hor[11] = "天蠍座";
hor[12] = "蛇夫座";
hor[13] = "射手座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day = 0;
day = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

B10533073黃叡哲 提到...

#include

using namespace std;

int main(){
int m,d,day_code;
cout << "請輸入月份:" ;
cin >> m ;
cout << "請輸入日期:" ;
cin >> d ;

day_code = m*100+d;

string h[14]={"無此星座","魔羯座","水瓶座","雙魚座","白羊座","金牛座","雙子座",
"巨蟹座","獅子座","處女座","天秤座","天蠍座","蛇夫座","人馬座"};

switch(m){

case 1:
if(day_code<121){
cout << h[13];
}else
cout << h[1];
break;
case 2:
if(day_code>=217){
cout << h[2];
}else{
cout << h[1];
}
break;
case 3:
if(day_code>=312){
cout << h[3];
}else{
cout << h[2];
}
break;
case 4:
if(day_code>=419){
cout << h[4];
}else{
cout << h[3];
}
break;
case 5:
if(day_code>=514){
cout << h[5];
}else{
cout << h[4];
}
break;
case 6:
if(day_code>=622){
cout << h[6];
}else{
cout << h[5];
}
break;
case 7:
if(day_code>=721){
cout << h[7];
}else{
cout << h[6];
}
break;
case 8:
if(day_code>=811){
cout << h[8];
}else{
cout << h[7];
}
break;
case 9:
if(day_code>=916){
cout << h[9];
}else{
cout << h[8];
}
break;
case 10:
if(day_code>=1031){
cout << h[10];
}else{
cout << h[9];
}
break;
case 11:
if(day_code>=1124&&day_code<1130){
cout << h[11];
}else if(day_code>=1130){
cout << h[12];
}else{
cout << h[10];
}
break;
case 12:
if(day_code>=1130&&day_code<1218){
cout << h[12];
}else{
cout << h[13];
}
break;
default:
cout << h[0];
}
}

b10533085羅偉辰 提到...

#include

using namespace std;

int main(){
int m,d,day_code;
cout << "請輸入月份:" ;
cin >> m ;
cout << "請輸入日期:" ;
cin >> d ;

day_code = m*100+d;

string h[14]={"無此星座","魔羯座","水瓶座","雙魚座","白羊座","金牛座","雙子座",
"巨蟹座","獅子座","處女座","天秤座","天蠍座","蛇夫座","人馬座"};

switch(m){

case 1:
if(day_code<121){
cout << h[13];
}else
cout << h[1];
break;
case 2:
if(day_code>=217){
cout << h[2];
}else{
cout << h[1];
}
break;
case 3:
if(day_code>=312){
cout << h[3];
}else{
cout << h[2];
}
break;
case 4:
if(day_code>=419){
cout << h[4];
}else{
cout << h[3];
}
break;
case 5:
if(day_code>=514){
cout << h[5];
}else{
cout << h[4];
}
break;
case 6:
if(day_code>=622){
cout << h[6];
}else{
cout << h[5];
}
break;
case 7:
if(day_code>=721){
cout << h[7];
}else{
cout << h[6];
}
break;
case 8:
if(day_code>=811){
cout << h[8];
}else{
cout << h[7];
}
break;
case 9:
if(day_code>=916){
cout << h[9];
}else{
cout << h[8];
}
break;
case 10:
if(day_code>=1031){
cout << h[10];
}else{
cout << h[9];
}
break;
case 11:
if(day_code>=1124&&day_code<1130){
cout << h[11];
}else if(day_code>=1130){
cout << h[12];
}else{
cout << h[10];
}
break;
case 12:
if(day_code>=1130&&day_code<1218){
cout << h[12];
}else{
cout << h[13];
}
break;
default:
cout << h[0];
}
}

B10533011 江道逸 提到...


#include <string>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
string hor[14];
hor[0] = "無此星座";
hor[1] = "摩羯座";
hor[2] = "水瓶座";
hor[3] = "雙魚座";
hor[4] = "牡羊座";
hor[5] = "金牛座";
hor[6] = "雙子座";
hor[7] = "巨蟹座";
hor[8] = "獅子座";
hor[9] = "處女座";
hor[10] = "天秤座";
hor[11] = "天蠍座";
hor[12] = "蛇夫座";
hor[13] = "射手座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day = 0;
day = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

B10533011 江道逸 提到...

switch(m){
case 1 :
if (day_code<121)n=13;
else n=1;
break ;
case 2 :
if (day_code<217)n=1;
else n=2;
break ;
case 3 :
if (day_code<312)n=2;
else n=3;
break ;
case 4 :
if (day_code<419)n=3;
else n=4;
break ;
case 5 :
if (day_code<514)n=4;
else n=5;
break ;
case 6 :
if (day_code<622)n=5;
else n=6;
break ;
case 7 :
if (day_code<721)n=6;
else n=7;
break ;
case 8 :
if (day_code<811)n=7;
else n=8;
break ;
case 9 :
if (day_code<916)n=8;
else n=9;
break ;
case 10 :
if (day_code<1031)n=9;
else n=10;
break ;
case 11 :
if (day_code<1124)n=10;
else if(day_code<1130) n=11 ;
else n=12;
break ;
case 12 :
if (day_code<1218)n=12;
else n=13;
break ;
default :
n=0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533071徐琮淇 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533072 吳堉瑋 提到...

#include

using namespace std;

int main(){
int m,d,day_code;
cout << "請輸入月份:" ;
cin >> m ;
cout << "請輸入日期:" ;
cin >> d ;

day_code = m*100+d;

string h[14]={"無此星座","魔羯座","水瓶座","雙魚座","白羊座","金牛座","雙子座",
"巨蟹座","獅子座","處女座","天秤座","天蠍座","蛇夫座","人馬座"};

switch(m){

case 1:
if(day_code<121){
cout << h[13];
}else
cout << h[1];
break;
case 2:
if(day_code>=217){
cout << h[2];
}else{
cout << h[1];
}
break;
case 3:
if(day_code>=312){
cout << h[3];
}else{
cout << h[2];
}
break;
case 4:
if(day_code>=419){
cout << h[4];
}else{
cout << h[3];
}
break;
case 5:
if(day_code>=514){
cout << h[5];
}else{
cout << h[4];
}
break;
case 6:
if(day_code>=622){
cout << h[6];
}else{
cout << h[5];
}
break;
case 7:
if(day_code>=721){
cout << h[7];
}else{
cout << h[6];
}
break;
case 8:
if(day_code>=811){
cout << h[8];
}else{
cout << h[7];
}
break;
case 9:
if(day_code>=916){
cout << h[9];
}else{
cout << h[8];
}
break;
case 10:
if(day_code>=1031){
cout << h[10];
}else{
cout << h[9];
}
break;
case 11:
if(day_code>=1124&&day_code<1130){
cout << h[11];
}else if(day_code>=1130){
cout << h[12];
}else{
cout << h[10];
}
break;
case 12:
if(day_code>=1130&&day_code<1218){
cout << h[12];
}else{
cout << h[13];
}
break;
default:
cout << h[0];
}
}

B10533007 魏辰熾 提到...

#include <string>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
string hor[14];
hor[0] = "無此星座";
hor[1] = "摩羯座";
hor[2] = "水瓶座";
hor[3] = "雙魚座";
hor[4] = "牡羊座";
hor[5] = "金牛座";
hor[6] = "雙子座";
hor[7] = "巨蟹座";
hor[8] = "獅子座";
hor[9] = "處女座";
hor[10] = "天秤座";
hor[11] = "天蠍座";
hor[12] = "蛇夫座";
hor[13] = "射手座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day = 0;
day = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

b10533006 劉純賓 提到...

#include <string>
#include <iostream>
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533008張士晟 提到...

#include <string>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
string hor[14];
hor[0] = "無此星座";
hor[1] = "摩羯座";
hor[2] = "水瓶座";
hor[3] = "雙魚座";
hor[4] = "牡羊座";
hor[5] = "金牛座";
hor[6] = "雙子座";
hor[7] = "巨蟹座";
hor[8] = "獅子座";
hor[9] = "處女座";
hor[10] = "天秤座";
hor[11] = "天蠍座";
hor[12] = "蛇夫座";
hor[13] = "射手座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day = 0;
day = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

B10533010蕭凱維 提到...

#include
#include
using namespace std:

int main(int argc, char** argv) {
string horoscope[14];
__Select__[0] = "無此星座";
__Select__[1] = "摩羯座";
__Select__[2] = "水瓶座";
__Select__[3] = "雙魚座";
__Select__[4] = "白羊座";
__Select__[5] = "金牛座";
__Select__[6] = "雙子座";
__Select__[7] = "巨蟹座";
__Select__[8] = "獅子座";
__Select__[9] = "處女座";
__Select__[10] = "天秤座";
__Select__[11] = "天蠍座";
__Select__[12] = "蛇夫座";
__Select__[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n=11
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533019 葉佳倫 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533082 洪承楓 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533063 陳廣制 提到...

B10533063 陳廣制 提到...
#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10514033盧昱仁 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533038楊尹玄 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533032程泓瑋 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533010蕭凱維 提到...

#include
#include
using namespace std:

int main(int argc, char** argv) {
string horoscope[14];
__Select__[0] = "無此星座";
__Select__[1] = "摩羯座";
__Select__[2] = "水瓶座";
__Select__[3] = "雙魚座";
__Select__[4] = "白羊座";
__Select__[5] = "金牛座";
__Select__[6] = "雙子座";
__Select__[7] = "巨蟹座";
__Select__[8] = "獅子座";
__Select__[9] = "處女座";
__Select__[10] = "天秤座";
__Select__[11] = "天蠍座";
__Select__[12] = "蛇夫座";
__Select__[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n=11
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533031沈宏儒 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533009 張仲崴 提到...

#include
#include
using namespace std;
int main(int argc, char** argv) {
string hor[14];
hor[0] = "無此星座";
hor[1] = "摩羯座";
hor[2] = "水瓶座";
hor[3] = "雙魚座";
hor[4] = "牡羊座";
hor[5] = "金牛座";
hor[6] = "雙子座";
hor[7] = "巨蟹座";
hor[8] = "獅子座";
hor[9] = "處女座";
hor[10] = "天秤座";
hor[11] = "天蠍座";
hor[12] = "蛇夫座";
hor[13] = "射手座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day = 0;
day = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day < 121) n = 13;
else n = 1;
break;
case 2 :
if (day < 217) n = 1;
else n = 2;
break;
case 3 :
if (day < 312) n = 2;
else n = 3;
break;

case 4 :
if (day < 419) n = 3;
else n = 4;
break;

case 5 :
if (day < 514) n = 4;
else n = 5;
break;

case 6 :
if (day < 622)n = 5;
else n = 6;
break;

case 7 :
if (day < 721) n = 6;
else n = 7;
break;

case 8 :
if (day < 811) n = 7;
else n = 8;
break;

case 9 :
if (day < 916) n = 8;
else n = 9;
break;

case 10 :
if (day < 1031) n = 9;
else n = 10;
break;

case 11 :
if (day < 1124) n = 10;
else if(day < 1130) n = 11;
else n = 12;
break;

case 12 :
if (day < 1218) n = 11;
else n = 12;
break;


default :
n = 0;
}
cout<<hor[n]<<endl;
return 0;
}

B10433088葉凱文 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533010蕭凱維 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
__Select__[0] = "無此星座";
__Select__[1] = "摩羯座";
__Select__[2] = "水瓶座";
__Select__[3] = "雙魚座";
__Select__[4] = "白羊座";
__Select__[5] = "金牛座";
__Select__[6] = "雙子座";
__Select__[7] = "巨蟹座";
__Select__[8] = "獅子座";
__Select__[9] = "處女座";
__Select__[10] = "天秤座";
__Select__[11] = "天蠍座";
__Select__[12] = "蛇夫座";
__Select__[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n=11
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533066曾楷杰 提到...

B10533066 曾楷杰
#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533029游淑娥 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

匿名 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

匿名 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533064蔡佩芸 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533101江翊菱 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<

b10533101江翊菱 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<

B10533132許敏茹 提到...

#include <string>
#include <iostream>

if (0) {
} else {
}

int main(int argc, char** argv) {
std::string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "雙子座";
horoscope[2] = "獅子座";
horoscope[3] = "天秤座";
horoscope[4] = "處女座";
horoscope[5] = "射手座";
horoscope[6] = "水瓶座";
horoscope[7] = "金牛座";
horoscope[8] = "巨蟹座";
horoscope[9] = "天蠍座";
horoscope[10] = "摩羯座";
horoscope[11] = "雙魚座";
horoscope[12] = "白羊座";
horoscope[13] = "人馬座";
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}
}

B10533088葉俊江 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10333093 徐子軒 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533083徐士興 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10537208楊蕊筑 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533075 陳詔瑋 提到...

switch(m){
case 1 :
if (day_code<121)n=13;
else n=1;
break ;
case 2 :
if (day_code<217)n=1;
else n=2;
break ;
case 3 :
if (day_code<312)n=2;
else n=3;
break ;
case 4 :
if (day_code<419)n=3;
else n=4;
break ;
case 5 :
if (day_code<514)n=4;
else n=5;
break ;
case 6 :
if (day_code<622)n=5;
else n=6;
break ;
case 7 :
if (day_code<721)n=6;
else n=7;
break ;
case 8 :
if (day_code<811)n=7;
else n=8;
break ;
case 9 :
if (day_code<916)n=8;
else n=9;
break ;
case 10 :
if (day_code<1031)n=9;
else n=10;
break ;
case 11 :
if (day_code<1124)n=10;
else if(day_code<1130) n=11 ;
else n=12;
break ;
case 12 :
if (day_code<1218)n=12;
else n=13;
break ;
default :
n=0;
}
cout<<horoscope[n]<<endl;
return 0;
}

b10533029 游淑娥 提到...

switch(m){
case 1 :
if (day_code<121)n=13;
else n=1;
break ;
case 2 :
if (day_code<217)n=1;
else n=2;
break ;
case 3 :
if (day_code<312)n=2;
else n=3;
break ;
case 4 :
if (day_code<419)n=3;
else n=4;
break ;
case 5 :
if (day_code<514)n=4;
else n=5;
break ;
case 6 :
if (day_code<622)n=5;
else n=6;
break ;
case 7 :
if (day_code<721)n=6;
else n=7;
break ;
case 8 :
if (day_code<811)n=7;
else n=8;
break ;
case 9 :
if (day_code<916)n=8;
else n=9;
break ;
case 10 :
if (day_code<1031)n=9;
else n=10;
break ;
case 11 :
if (day_code<1124)n=10;
else if(day_code<1130) n=11 ;
else n=12;
break ;
case 12 :
if (day_code<1218)n=12;
else n=13;
break ;
default :
n=0;
}
cout<<horoscope[n]<<endl;
return 0;
}

B10533093許永炎 提到...

#include
#include
using namespace std;

int main(int argc, char** argv) {
string horoscope[14];
horoscope[0] = "無此星座";
horoscope[1] = "魔羯座";
horoscope[2] = "水瓶座";
horoscope[3] = "雙魚座";
horoscope[4] = "白羊座";
horoscope[5] = "金牛座";
horoscope[6] = "雙子座";
horoscope[7] = "巨蟹座";
horoscope[8] = "獅子座";
horoscope[9] = "處女座";
horoscope[10] = "天秤座";
horoscope[11] = "天蠍座";
horoscope[12] = "蛇夫座";
horoscope[13] = "人馬座";
int m = 0;
int d = 0;
cout << "輸入月份:";
cin >> m;
cout << "輸入日期:";
cin >> d;
int day_code = 0;
day_code = ((100 * m) + d);
int n = 0;
switch (m) {
case 1 :
if (day_code < 121) n = 13;
else n = 1;
break;
case 2 :
if (day_code < 217) n = 1;
else n = 2;
break;
case 3 :
if (day_code < 312) n = 2;
else n = 3;
break;
case 4 :
if (day_code < 419) n = 3;
else n = 4;
break;
case 5 :
if (day_code < 514) n = 4;
else n = 5;
break;
case 6 :
if (day_code < 622) n = 5;
else n = 6;
break;
case 7 :
if (day_code < 721) n = 6;
else n = 7;
break;
case 8 :
if (day_code < 811) n = 7;
else n = 8;
break;
case 9 :
if (day_code < 916) n = 8;
else n = 9;
break;
case 10 :
if (day_code < 1031) n = 9;
else n = 10;
break;
case 11 :
if (day_code < 1124) n = 10;
else if(day_code < 1130) n = 11;
else n = 12;
break;
case 12 :
if (day_code < 1218) n = 12;
else n = 13;
break;
default :
n = 0;
}
cout<<horoscope[n]<<endl;
return 0;
}

Related Posts Plugin for WordPress, Blogger...

熱門文章