帮助打印日历 [英] Help with printing a calendar

查看:68
本文介绍了帮助打印日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我有这个代码打印出一个基于用户输入的年份和月份的日历!!!!!

但我只得到标题信息???有人可以看看在它并告诉我什么是错的?TANX

到目前为止我的代码是::


每个发布指南删除完整代码

hi i have this code to print out a calendar based on the year and month entered by user!!!!!
but im getting only the heading information ???can someone take a look at it and tell me whats wrong??TANX
my code so far is::

Full code removed per Posting Guidelines

推荐答案

我需要编写一个程序来打印12个月的calandar给出的弱日,应该是2001年和2004年(闰年)的1月1日!我知道闰年的测试,我已经写好了确定几个月的天数。

i只是不知道如何打印calandar像

SMTW TH F SU

1 2 3 4 5 6

7 8 9 10 11 12 13

等......等等下个月应该跟随上个月的结束


...我确定我必须使用参考变量,但我不确定如何?

可以你们给我任何想法吗?

TANX
i need to write a program that prints the 12 months calandar given the weakday which should be the 1st of January for the years of 2001 and 2004( a leap year)!!! i know the test for leap year and i have written the FUN to determine the number of the days of months.
i just dont know how to print the calandar like
S M T W TH F SU
1 2 3 4 5 6
7 8 9 10 11 12 13
and so on....and the the of the next month should follow the end of previous month

... im sure i have to use the reference variables but im not sure how??
can you guys give me any ideas?
TANX


这应该只是决定每个月有多少天,然后将它们打印成对齐(检查out为iomanip头文件中的setw()函数。前半部分是简单逻辑和常量的混合,后半部分是实验并且使它看起来很漂亮。
It should just be a matter of deciding how many days each month has, and then printing them in alignment (check out the setw() function in the iomanip header file for this). The first half is a mixture of simple logic and constants, the second half is experiment and ''making it look pretty''.



它应该只是决定每个月有多少天,然后将它们对齐打印(请查看iomanip头文件中的setw()函数)。前半部分是简单逻辑和常量的混合,后半部分是实验并且使它看起来很漂亮。
It should just be a matter of deciding how many days each month has, and then printing them in alignment (check out the setw() function in the iomanip header file for this). The first half is a mixture of simple logic and constants, the second half is experiment and ''making it look pretty''.



我知道esch月有多少天了。我不知道锄头把1月的第一天放在用户选择的那一天吗?

就像用户输入2(周日是1和星期六是7)1月1日那样应该是星期一!!!!!任何想法?

i know how many days esch month has. i dont know hoe to put the first day of January on the day of the week that user chooses?
like when a user inputes 2 (when Sunday is 1 and saturday is 7) the 1st day of january should be on monday!!!!!any ideas?


这篇关于帮助打印日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆