用C语言编程判断N天以后星期几
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/12 12:10:09
用C语言编程判断N天以后星期几
目的是,输入今天星期几的单词,然后再输入N,运行判断N天后是星期几,输出.
以下是我编的程序,能不能帮忙挑下错?始终输入天数以后就跳出了.
#include
#include
void main()
{
int h=0;
int n,g;
char a[10];
char week_day[][10]={"sunday","monday","tuesday","wednesday","thursday","friday","saturday"};
printf("请输入一个星期的单词:\n");
gets(a);
int i;
for(i=0;i
目的是,输入今天星期几的单词,然后再输入N,运行判断N天后是星期几,输出.
以下是我编的程序,能不能帮忙挑下错?始终输入天数以后就跳出了.
#include
#include
void main()
{
int h=0;
int n,g;
char a[10];
char week_day[][10]={"sunday","monday","tuesday","wednesday","thursday","friday","saturday"};
printf("请输入一个星期的单词:\n");
gets(a);
int i;
for(i=0;i
scanf语句要加取地址符& 改为scanf("%d",&h);