北京师范大学珠海分校
Judge Online of ACM ICPC
1065 时尚的辉蛋
C语言版
Judge Online of ACM ICPC
1065 时尚的辉蛋
C语言版
- #include <stdio.h>
- int main(){
- double score[12][3]={{0.75,0.80,0.70},{0.65,0.78,0.92},{0.72,0.60,0.85},{0.85,0.95,0.88},{0.73,0.69,0.84},{0.92,0.87,0.69},{0.66,0.86,0.76},{0.75,0.92,0.80},{0.86,0.77,0.95},{0.84,0.78,0.90},{0.97,0.68,0.87},{0.66,0.79,0.63}};
- char name[12][20]={"Capricorn","Aquarius","Pisces","Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius"};
- char point[3][20]={"luck point:","love point:","success point:"};
- int i,j,y,m,d;
- char c;
- while(1){
- scanf("%d-%d-%d",&y,&m,&d);
- if (y==9999&&m==12&&d==31) break;
- getchar();
- scanf("%c",&c);
- if ((m==12&&d>=22)||(m==1&&d<=19)) i=1;
- else if ((m==1&&d>=20)||(m==2&&d<=18)) i=2;
- else if ((m==2&&d>=19)||(m==3&&d<=20)) i=3;
- else if ((m==3&&d>=21)||(m==4&&d<=19)) i=4;
- else if ((m==4&&d>=20)||(m==5&&d<=20)) i=5;
- else if ((m==5&&d>=21)||(m==6&&d<=21)) i=6;
- else if ((m==6&&d>=21)||(m==7&&d<=22)) i=7;
- else if ((m==7&&d>=23)||(m==8&&d<=22)) i=8;
- else if ((m==8&&d>=23)||(m==9&&d<=22)) i=9;
- else if ((m==9&&d>=23)||(m==10&&d<=22)) i=10;
- else if ((m==10&&d>=23)||(m==11&&d<=21)) i=11;
- else if ((m==11&d>=22)||(m==12&&d<=21)) i=12;
- switch(c){
- case 'A':j=2;break;
- case 'X':j=1;break;
- case 'S':j=3;break;
- }
- printf("%s/n%s %.2lf/n",name[i-1],point[j-1],score[i-1][j-1]);
- }
- return 0;
- }