C语言 星期几?答:char a[8][20]={"www","星期一","星期二","星期三","星期四","星期五","星期六","星期日",};scanf("%d%d",&n,&m);for(int i=1;i<=m;i++)//从星期n开始过m天;也就是循环m次;{//n在[1,7]之间不停的循环;if(n!=7)//不等于星期日,星期数加一;n++;if(n==7...
c语言输出字母星期一到星期日答:THI, SUN };int main(int argc, char *argv[]){ int i; char day[][3] = "{MON}, {TUE}, {WIN}, {THE}, {FRI}, {THI}, {SUN}"; for(i = MON; i <= SUM, i++) printf("%s\t", day[MON -
用C语言编写一个程序,将输入的英文星期单词转化为中文输出答:include <stdio.h>#include <string.h>char *weeks[]={"Monday","Tuesday","Wednesday","Thursday","Friday", "Saturday","Sunday"};char *trans[]={"星期一","星期二","星期三","星期四","星期五","星期六","星期日"};void translate(char *pstr){int i;for(i=0;i<7;i++){...
C语言中如果从键盘上输入一个代表星期几的数值(整数),根据下面的对应关 ...答:char *pw[7]={"一","二","三","四","五","六","日"},w; while(1){ printf("Input w(1-7,w<=0 end): w="); if(scanf("%d",&w) && w>0 && w<8) printf("%d <--> 星期%s\n",w,pw[w-1]); else if(...