求一道c语言程序设计题 2010年12个月的输出,按照所对应的星期输出
void main(){ int year=0;int count=0;int i,j;long daysfrom1900=0;\/\/19001月1日为星期一 char flag='y';int a[12]={31,28,31,30,31,30,31,30,31,31,30,31};int b[12]={31,29,31,30,31,30,31,30,31,31,30,31};printf("请输入年份\\n");scanf("%d",&year);if(...
c语言设计万年历 输入任意年份,输出该年12个月份 输入任意年份月份...
struct tm *date; int year,m; while(1) { printf("输入任意年份及月份:\\n"); scanf("%d%d",&year,&m); if(m<1 || m>12) { printf("月份超出范围,重新输入!\\n"); continue; } mon=m; break; } date=getDate(year,mon);...
用c语言输入日期输出星期几
include <stdio.h>int main(int argc, char const *argv[]){int data;scanf("%d",&data);printf("星期%d\\n",(data +1)%7 + 1);return 0;}
C语言编程序实现如下功能:输入任意一个日期的年、月、日的值,求出是...
else if (m==9) c=31 28 31 30 31 30 31 31 d; else if (m==10) c=31 28 31 30 31 30 31 31 30 d; else if (m==11) c=31 28 31 30 31 30 31 31 30 31 d; else if (m==12) c=31 28 31 30 31 30 31 31 30 31 30 d; if (m>2) {if (y0==0) {if (y@0=...
C语言的问题:根据输入的年月日,输出该日为该年度的第几周、第几天、星...
\/\/根据输入的年月日,输出该日为该年度的第几周、第几天、星期几。\/\/如输入: 2007,12,1 \/\/则输出: 48z,335t,6xq int date[12]={31,28,31,30,31,30,31,31,30,31,30,31};include<stdio.h> int Check(int a,int b,int c);\/\/判断输入的合法性 int CountWeek(int a,int ...
跪求C语言万年历程序设计
include char* month_str[]={"一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"};char* week[]={"星期一","星期二","星期三","星期四","星期五","星期六","星期天"};int IsLeapYear(int year){ if((year%4==0&&year%100!=0...
c语言课程设计,关于年历显示。下面是要求: (1) 输入一个年份,输出是在...
int firstweek; \/\/每个月份第一天,星期几。int line =0;scanf("%d",&inputyear);if(isLeapYear(inputyear)){ monthday[1]++;} printf("*** %d ***\\n",inputyear);for(i = 0;i<12;i++) \/\/先一个月份一个月份的输出。{ printf("\\n===\\n");printf("%s\\n",monthname[i]...
C语言,输入年月日,输出星期几
case 12:t+=31;break;} } return t;} void inputCheck(int year,int month,int day){ if(year<0)printf("input is wrong!\\n");else { switch(month){ case 2:if(day>28 && (!((year%4==0 && year%100!=0) || (year%400==0)))printf("input is wrong!\\n");if(day>...
用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语言中如果从键盘上输入一个代表星期几的数值(整数),根据下面的对应关 ...
用一个指针数组存放汉字"一"到"日"字符串的指针,可用简单代码解决这问题。举例如下:\/\/#include "stdafx.h"\/\/If the vc++6.0, with this line.#include "stdio.h"int main(void){ char *pw[7]={"一","二","三","四","五","六","日"},w; while(1){ printf("Input...