tfsf.net
当前位置:首页>>关于用C语言编程,在1994~1998年之间输入一个年份,简单输出日历的资料>>

用C语言编程,在1994~1998年之间输入一个年份,简单输出日历

最直接的方式就是直接scanf("%d",&year)用几个if,例如:if(year == 1994)下面再printf()相应的月份和内容,用\r\n ,\t排版自己用心就行注意平年闰年

#include long int f(int year,int month) { if(month else return year; } long int g(int month) { if(month else return month+1; } long int n(int year,int month,int day) { return 1461l*f(year,month)/4+153l*g(month)/5+day; } int w(int year,int month,int day) { return(

#includevoid main(){ printlf("******************欢 迎 使 用 万 年 历******************"); printf("\n请选择年份: "); int year = 0; bool isRn; scanf("%d",&year);whlie(year 2015){ if(year >= 1994 && year 评论0 0 0

#include <stdio.h> #define YEAR 365 int leap(int year) { int n; n=(year%4==0&&year%4!=0||year%400==0); return(n); } void count(int year, int month) /*基:2000年1月*/ { int i,day,first_day,flag,year1,year2,temp=6; flag=leap(year); year1=year/100

#include <stdio.h> long int f(int year,int month) { if(month<3) return year-1; else return year; } long int g(int month) { if(month<3) return month+13; else return month+1; }long int n(int year,int month,int day) { return 1461L*f(year,month)/4+153L*g(month)

#include<stdio.h>int main(){ int m[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int i,y,j; scanf("%d",&y); for(i=1;i<=12;i++) { printf("%d 月:\n",i); if( ((y%4==0 && y%100!=0)||y%400==0) && i==2) //闰年并且是二月份. { for(j=1;j<=m[i]+1;j++) {

if(month==4||6||9||11) if(month==1||3||5||7||8||10||12)这种写法是错误的.应该这样写 if(month==4||month==6||month==9||month==11) if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)另外,其实你可以不这么写,太多

* welcome to use the WanNianLi system! Copyright @ 2005 KongXinCai All rights reserved!:):):)*/ #include<stdio.h> #include<stdlib.h> char* month_str[]={"January","February","March","April","May","June","July","August","

// aa.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include #include #include #include #include #include void tiangan(int x) {char a[][10]={"甲","乙","丙","丁","戊","己","庚","辛","壬","癸"}

#include<stdio.h> #include<stdlib.h> char* month_str[]={"January","February","March","April","May","June","July","August","September","October","November","December"}; char* week[]={"Sunday","Monday"

网站首页 | 网站地图
All rights reserved Powered by www.tfsf.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com