zoukankan      html  css  js  c++  java
  • 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;
    
    
    }
  • 相关阅读:
    Java编程之路相关书籍
    JAVA中的Random()函数
    在鼠标右键上加入使用notepad++编辑
    更改IE浏览器的收藏夹位置
    Java四类八种数据类型
    成为Java顶尖程序员 ,看这11本书就够了
    面向对象(多异常的声明与处理)
    面向对象(异常try-catch)
    面向对象(异常概述)
    面向对象(局部内部类和匿名内部类)
  • 原文地址:https://www.cnblogs.com/Stephen-Jixing/p/9866700.html
Copyright © 2011-2022 走看看