C++编写谷歌日历

#include<iostream>
#include<fstream>
using namespace std;
void main() //程序从这里开始运行
{
    int day;

    ofstream fout("D:\jixingkebiao.ics");

    //基本内容输入
    fout << "BEGIN:VCALENDAR" << endl;
    fout << "PRODID:-//Google Inc//Google Calendar 70.9054//EN" << endl;
    fout << "VERSION:2.0" << endl;
    fout << "CALSCALE:GREGORIAN" << endl;
    fout << "METHOD:PUBLISH" << endl;
    fout << "X-WR-CALNAME:课程表" << endl;
    fout << "X-WR-TIMEZONE:Asia/Shanghai" << endl;

    //输入英语课表
    for (int t = 0; t < 2; t++)
    {
        day = 5;
        fout << "BEGIN:VEVENT" << endl;
        if (t == 0) {

            fout << "DTSTART:2018030" << day << "T000000Z" << endl;
            fout << "DTEND:2018030" << day << "T013500Z" << endl;
            fout << "LOCATION:北综楼 111/胡冬梅" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180604T155959Z" << endl;
        }
        else
        {
            fout << "DTSTART:2018030" << day + 3 << "T020500Z" << endl;
            fout << "DTEND:2018030" << day + 3 << "T034000Z" << endl;
            fout << "LOCATION:北综楼 111/胡冬梅" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180607T155959Z" << endl;
        }

        fout << "DESCRIPTION:" << endl;
        fout << "SEQUENCE:0" << endl;
        fout << "STATUS:CONFIRMED" << endl;
        fout << "SUMMARY:大学英语" << endl;
        fout << "TRANSP:OPAQUE" << endl;
        fout << "END:VEVENT" << endl;
    }
    //输入数字逻辑课表
    for (int t = 0; t < 2; t++)
    {
        day = 5;
        fout << "BEGIN:VEVENT" << endl;
        if (t == 0) {

            fout << "DTSTART:2018030" << day << "T020500Z" << endl;
            fout << "DTEND:2018030" << day << "T034000Z" << endl;
            fout << "LOCATION:综合楼303/墙威" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180507T155959Z" << endl;
        }
        else {

            fout << "DTSTART:2018030" << day + 2 << "T060000Z" << endl;
            fout << "DTEND:2018030" << day + 2 << "T073500Z" << endl;
            fout << "LOCATION:综合楼408/墙威" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180509T155959Z" << endl;

        }

        fout << "DESCRIPTION:" << endl;
        fout << "SEQUENCE:0" << endl;
        fout << "STATUS:CONFIRMED" << endl;
        fout << "SUMMARY:数字逻辑" << endl;
        fout << "TRANSP:OPAQUE" << endl;
        fout << "END:VEVENT" << endl;
    }
    //输入高等数学课表
    day = 5;

    for (int t = 0; t < 3; t++)
    {
        fout << "BEGIN:VEVENT" << endl;
        if (t == 0) {

            fout << "DTSTART:2018030" << day << "T060000Z" << endl;
            fout << "DTEND:2018030" << day << "T073500Z" << endl;
            fout << "LOCATION:综合楼303/李少华" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180702T155959Z" << endl;
        }
        else if (t == 1)
        {
            fout << "DTSTART:2018030" << day + 2 << "T000000Z" << endl;
            fout << "DTEND:2018030" << day + 2 << "T013500Z" << endl;
            fout << "LOCATION:综合楼304/李少华" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180704T155959Z" << endl;
        }
        else if (t == 2)
        {
            fout << "DTSTART:2018030" << day + 4 << "T060000Z" << endl;
            fout << "DTEND:2018030" << day + 4 << "T073500Z" << endl;
            fout << "LOCATION:综合楼207/李少华" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180706T155959Z" << endl;
        }
        fout << "DESCRIPTION:" << endl;
        fout << "SEQUENCE:0" << endl;
        fout << "STATUS:CONFIRMED" << endl;
        fout << "SUMMARY:高等数学" << endl;
        fout << "TRANSP:OPAQUE" << endl;
        fout << "END:VEVENT" << endl;
    }
    //输入电工与电子技术课表

    day = 6;

    for (int t = 0; t < 2; t++)
    {
        fout << "BEGIN:VEVENT" << endl;
        if (t == 0) {

            fout << "DTSTART:2018030" << day << "T000000Z" << endl;
            fout << "DTEND:2018030" << day << "T013500Z" << endl;
            fout << "LOCATION:综合楼307/胡志敏" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180508T155959Z" << endl;
        }
        else
        {

            fout << "DTSTART:2018030" << day + 2 << "T000000Z" << endl;
            fout << "DTEND:2018030" << day + 2 << "T013500Z" << endl;
            fout << "LOCATION:综合楼111/胡志敏" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180510T155959Z" << endl;

        }

        fout << "DESCRIPTION:" << endl;
        fout << "SEQUENCE:0" << endl;
        fout << "STATUS:CONFIRMED" << endl;
        fout << "SUMMARY:电工与电子技术" << endl;
        fout << "TRANSP:OPAQUE" << endl;
        fout << "END:VEVENT" << endl;
    }

    //输入离散数学课表

    day = 3;

    for (int t = 0; t < 2; t++)
    {
        fout << "BEGIN:VEVENT" << endl;
        if (t == 0) {
            fout << "DTSTART:2018040" << day << "T060000Z" << endl;
            fout << "DTEND:2018040" << day << "T073500Z" << endl;
            fout << "LOCATION:教一楼503/吴亦奇" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180703T155959Z" << endl;
        }
        else
        {
            fout << "DTSTART:2018040" << day + 3 << "T000000Z" << endl;
            fout << "DTEND:2018040" << day + 3 << "T013500Z" << endl;
            fout << "DESCRIPTION:" << endl;
            fout << "LOCATION:教一楼404/吴亦奇" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180706T155959Z" << endl;

        }
        fout << "DESCRIPTION:" << endl;
        fout << "SEQUENCE:0" << endl;
        fout << "STATUS:CONFIRMED" << endl;
        fout << "SUMMARY:离散数学" << endl;
        fout << "TRANSP:OPAQUE" << endl;
        fout << "END:VEVENT" << endl;
    }
    //输入地球科学概论课表

    day = 6;

    for (int t = 0; t < 2; t++)
    {
        fout << "BEGIN:VEVENT" << endl;
        if (t == 0) {

            fout << "DTSTART:2018030" << day << "T110000Z" << endl;
            fout << "DTEND:2018030" << day << "T123500Z" << endl;
            fout << "LOCATION:综合楼410/任利民" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180424T155959Z" << endl;
        }
        else
        {
            fout << "DTSTART:2018030" << day + 2 << "T110000Z" << endl;
            fout << "DTEND:2018030" << day + 2 << "T123500Z" << endl;
            fout << "LOCATION:综合楼106/任利民" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180426T155959Z" << endl;
        }

        fout << "DESCRIPTION:" << endl;
        fout << "SEQUENCE:0" << endl;
        fout << "STATUS:CONFIRMED" << endl;
        fout << "SUMMARY:地球科学概论" << endl;
        fout << "TRANSP:OPAQUE" << endl;
        fout << "END:VEVENT" << endl;
    }
    //输入体育课课表

    day = 7;

    fout << "BEGIN:VEVENT" << endl;

    fout << "DTSTART:2018030" << day << "T020500Z" << endl;
    fout << "DTEND:2018030" << day << "T034000Z" << endl;
    fout << "RRULE:FREQ=WEEKLY;UNTIL=20180704T155959Z" << endl;
    fout << "LOCATION:北区体育馆/袁春梅" << endl;
    fout << "DESCRIPTION:" << endl;
    fout << "SEQUENCE:0" << endl;
    fout << "STATUS:CONFIRMED" << endl;
    fout << "SUMMARY:乒乓球初级班" << endl;
    fout << "TRANSP:OPAQUE" << endl;
    fout << "END:VEVENT" << endl;

    //输入高级软件编程技术课表

    day = 16;
    for (int t = 0; t < 2; t++)
    {
        fout << "BEGIN:VEVENT" << endl;
        if (t == 0) {

            fout << "DTSTART:201805" << day << "T060000Z" << endl;
            fout << "DTEND:201805" << day << "T073500Z" << endl;
            fout << "LOCATION:教一楼408/熊慕舟" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180627T155959Z" << endl;
        }
        else
        {
            fout << "DTSTART:201805" << day + 2 << "T020500Z" << endl;
            fout << "DTEND:201805" << day + 2 << "T034000Z" << endl;
            fout << "LOCATION:教一楼408/熊慕舟" << endl;
            fout << "RRULE:FREQ=WEEKLY;UNTIL=20180627T155959Z" << endl;
        }
        fout << "DESCRIPTION:" << endl;
        fout << "SEQUENCE:0" << endl;
        fout << "STATUS:CONFIRMED" << endl;
        fout << "SUMMARY:高级软件编程技术" << endl;
        fout << "TRANSP:OPAQUE" << endl;
        fout << "END:VEVENT" << endl;
    }

    fout << "END:VCALENDAR";
    fout.close();

    return;

}

原文地址:https://www.cnblogs.com/Stephen-Jixing/p/9866700.html

时间: 2024-11-07 15:55:28

C++编写谷歌日历的相关文章

html编写的日历

1.html (1) <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>日历</title> </head> <body> <style> <!-- .tablinks a, .tablinks a:visited{ color:blue

编写一个日历控件

这一小节就编写一个小小日历.日历的编写看起来不容易,实际上掌握了思路,编写起来也很简单.日历的制作可以转化成一个二维数组的排序,根据排序然后生成html代码. 1.首先确定这个月的第一天是星期几,再利用这日期确定其它日期的位置,最后定制成一个二维数组,根据二维数组生成html. 2.监听事件,无非是上一年,上个月,下个月,下一年等. 3.触发事件,点击完按钮后,日期重新计算.然后做的事情很简单,再按第一步进行. 第一步: 确定这个月的第一天是星期几,比如这个月是2月1号,对应的是星期天. var

谷歌日历的正确用法--在谷歌日历中添加农历、天气、中国节假日

1. 在PC端设置农历.天气.中国节假日 (1)添加农历: 在电脑通过浏览器打开google calender页面  https://calendar.google.com 并登录google帐号 设置--添加日历--通过网址添加, 输入农历日历网址http://www.google.com/calendar/ical/[email protected]/public/basic.ics 并确认 或者在日历主页点击“添加朋友的日历”后面的+号, 通过网址添加,输入农历日历网址http://www

10.5 多视图模式日历案例概述

在接下来的几节中,我们将围绕“日历”这个案例进行实战演练,以提高读者对CSS的掌握和理解深度. 日历是日常生活中随处可见的工具.计算机出现后,产生了很多供人们记录日程安排的备忘录软件.随着互联网的普及,将日历存储在互联网上就更方便了,无论走到哪里,只要能够登录互联网,就可以随时查询和登记各种日程信息. Google推出了功能非常强大的日历软件,它不但具有普通日历的功能,还和移动通信相结合,用户可以和手机绑定,到达设定的时间时,用户就会收到一条提示短信.“Google日历”是完全基于Web的应用程

365日历:信息与社区化的新模式

[模式] 365日历由一款工具类App,向信息化平台转型,一方面为经过认证的网站和商家的日历大号做导流,同时提供个性化内容的增值服务,开辟了自己独有的O2O模式. [特点] 1.在日历上搭建信息平台,方便用户在日历上看到各种有价值的信息: 2.流动的信息使365日历在一定程度上具备了媒体属性,这使得商业化路线更为清晰: 3.将日常生活中的关系引入到日历当中,其粘性因为关系和功能进一步增加: 4.日历的不同信息把用户分类成一个个垂直的圈子,形成一个个小型社区化: 5.365日历会对进入日历广场的日

调用Android自带日历功能

Android手机配备有一个内置的日历应用程序.第三方应用程序可以利用日历内容提供商接口读取用户的日历信息和安排在日历新的事件.这个日历可以直接同步用户的谷歌日历. 不幸的是,没有文档和Android手机的日历应用集成,因为有另外一个联系人应用程序.相反,本文所提供的所有信息,将会通过逆向工程的谷歌日历内容提供商.该接口是受变化的,将会支持有限的功能.然而,日历一体化可以成为一些类型的应用强大的功能. 本文的代码测试之到Android 2.0 SDK版本.我们将发布一个更新如果有一个很大的转变.

Google Calendar(日历)设置农历生日提醒

Generate birthday dates base on lunar birthdays for google calendar import Can be used for notifying birthdays using google calendar根据农历生日生成可用于谷歌日历导入的csv文件, 然后导入谷歌日历就可以每年收到所有家人的生日提醒了 打开http://play.golang.org/p/pjHLGH_HjP  http://play.golang.org/p/6pt

测试人机问答系统智能性的3760个问题

本文给出了3760个问题,这些问题来自于广大网友对QuestionAnsweringSystem的测试. 在面对这些问题的时候,我们人类是怎么思考回答的呢? 对我们来说,回答这些问题是一个很自然甚至很简单的思考过程,可是我们却很难把我们的思考过程严格地描述清楚.我们从小到大,积累了很多的经验和知识,这些经验和知识来自我们的社会实践和学校学习. 我们所处的世界不是完美的,我们本身也不是完美的,人与人的相互交流也不是完美的,我们经常需要反复地沟通,尽管这样,有时候我们还是不能完全理解对方的意思,有可

我的高效编程秘诀

高效编程.高效学习.高效工作.高效生活 高效的意思是指在相同或更短的时间里完毕比其她人很多其它的任务,并且质量与其她人一样或者更好.用英文来说就是write less.do more.这是程序永远的主题,在我们日常编程中一段代码常常复用的时候我们会进行代码封装,借助一些工具来高速定位错误这些都有利于提高我们编程的效率.今天和小伙伴们聊聊高效编程的秘诀,事实上不仅仅是高效编程的秘诀,更是高效学习.生活和工作的秘诀,由于小编感觉编程就如同人生一样,一样的丰富多彩,一样的璀璨夺目.指导小编高效编程.生