Fortune Telling Collection - Zodiac Guide - Constellation fortune-telling code daquan _ constellation fortune-telling code daquan pictures
Constellation fortune-telling code daquan _ constellation fortune-telling code daquan pictures
The program is not very good, not very simplified. Enter the format month-day name.
If the input format does not match, it is over. The results are saved in a tab. Txt document.
You can try.
# include & ltstdio.h & gt
int main(int argc,char *argv[])
{
Char t, a[50][20] = {{0}, Aquarius, Pisces, Aries, Taurus, Gemini, Cancer, Leo, Virgo, Libra, Scorpio and Sagittarius.
Int month and day;
FILE * fp
if((fp=fopen("tab.txt "," w"))==NULL)
{
Printf ("Can't be great tab.txt!" );
Returns 0;
}
Printf ("Please enter the date and name, for example: 04-04- 10 James \ n "););
while( 1)
{
Scanf("%d-%d %s%*c ",& day & amp);
Switch (month)
{
Case12: {if (day > =22){fprintf(fp, "%d-%d% s \ n", month, day, a[ 12], b); printf("%s\n ",a[ 12]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[ 1 1],b); printf("%s\n ",a[ 1 1]); Break; }}
Case11:{if (day > =22){fprintf(fp, "%d-%d% s \ n", month, day, a[ 1 1], b); printf("%s\n ",a[ 1 1]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[ 10],b); printf("%s\n ",a[ 10]); Break; }}
Case10: {if (day > =23){fprintf(fp, "%d-%d% s \ n", month, day, a[ 10], b); printf("%s\n ",a[ 10]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[9],b); printf("%s\n ",a[9]); Break; }}
Situation 9: {if (day > =23){fprintf(fp," %d-%d %s %s\n ",month,day,a[9],b); printf("%s\n ",a[9]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[8],b); printf("%s\n ",a[8]); Break; }}
Case 8: {if (day > =23){fprintf(fp," %d-%d %s %s\n ",month,day,a[8],b); printf("%s\n ",a[8]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[7],b); printf("%s\n ",a[7]); Break; }}
Situation 7: {if (day > =23){fprintf(fp," %d-%d %s %s\n ",month,day,a[7],b); printf("%s\n ",a[7]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[6],b); printf("%s\n ",a[6]); Break; }}
Case 6: {if (day > =22){fprintf(fp, "%d-%d %s %s\n", month, day, a[6], b); printf("%s\n ",a[6]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[5],b); printf("%s\n ",a[5]); Break; }}
Situation 5: {if (day > =2 1){fprintf(fp, "%d-%d %s %s\n", month, day, a[5], b); printf("%s\n ",a[5]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[4],b); printf("%s\n ",a[4]); Break; }}
Situation 4: {if (day > =2 1){fprintf(fp, "%d-%d %s %s\n", month, day, a[4], b); printf("%s\n ",a[4]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[3],b); printf("%s\n ",a[3]); Break; }}
Situation 3: {if (day > =2 1){fprintf(fp, "%d-%d %s %s\n", month, day, a[3], b); printf("%s\n ",a[3]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[2],b); printf("%s\n ",a[2]); Break; }}
Case 2: {if (day > = 19){fprintf(fp, "%d-%d %s %s\n", month, day, a[2], b); printf("%s\n ",a[2]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[ 1],b); printf("%s\n ",a[ 1]); Break; }}
Case1:{if (day > =20){fprintf(fp, "%d-%d% s \ n", month, day, a[ 1], b); printf("%s\n ",a[ 1]); Break; }else{fprintf(fp," %d-%d %s %s\n ",month,day,a[ 12],b); printf("%s\n ",a[ 12]); Break; }}
}
}
fclose(FP);
Returns 0;
}
- Previous article:Hand-painted cartoon girl of twelve constellations
- Next article:The happiest constellation girl in the rest of my life.
- Related articles
- Is the constellation lunar or solar?
- Which constellation, even if it is crazy, should remain elegant, say the softest words and fight the hardest?
- 197 1 lunar calendar101what is the constellation on October 29th?
- Interpretation constellation
- Forest constellation _ forest constellation blood clan
- Jiang Shuying information photos What TV series and movies did Jiang Shuying play?
- What is the arrangement order of the twelve constellations?
- At the end of February 2022, there were many happy events and peach blossoms. What are the constellations where good luck will last?
- Check the constellation _ Netease Cloud How to check the constellation?
- Personal astrolabe analysis