Fortune Telling Collection - Comprehensive fortune-telling - How to write a constellation query system with C? Seek source code,
How to write a constellation query system with C? Seek source code,
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:Eight-character numerology chart
- Next article:Is there a place to apply for a visa in the Lama Temple? I don't think I have.
- Related articles
- The date of birth measures how many marriages he has had in his life, and how many marriages are free in his life. When did he get divorced?
- Trump fortune telling _ Trump numerology prediction
- Detailed cast list of legendary big treasurer
- Don't rely on time to tell fortune.
- 1981June 12 horoscope of male born in Shi Mao.
- Bad karma fortune teller _ real case of bad karma fortune teller
- Look at the free score of name words.
- Is it true that Jiuhua Mountain burns incense and tells fortune?
- Find out the disease analysis of the human body part corresponding to the tongue.
- Zhujiajiao Park Fortune Telling _ Zhujiajiao Fortune Telling