博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

C++编程设计之路

guanbin.cublog.cn


学习C++的第一个练习题
提示用户,程序在1分钟内关闭,并响铃3声。

// Exercise 2.11

// Create an application that prints a message and sounds an alarm.

#include <iostream> // required to perform C++ stream I/O


using namespace std; // for accessing C++ Standard Library members


// function main begins program execution

int main()
{
    cout << "\a\a\aWarning:You have been inactive for over 30 minutes \nYou will be logged out in one minute\n";
    
    system("pause"); // 暂停返回

       return 0; // indicate that program ended successfully

}

发表于: 2007-02-28 ,修改于: 2007-02-28 20:15,已浏览346次,有评论2条 推荐 投诉


网友评论
内容:
为什么会少一个头文件
#include <stdlib.h>
墨玉评论于:2007-03-24 10:16:48 (61.157.243.★)
内容:
System包含在io中。
本站网友评论于:2007-04-05 13:08:42 (219.130.2.★)

发表评论