摘要: 可以使用cout<< 和cin>>实现从键盘输入和输出到屏幕。using namespace std;#include <iostream>int main(){ int a; // a is an integer variable char s [100]; // s points to a string of max 99 characters cout << "This is a sample program." << endl; cout << endl; // Just a line... 阅读全文
posted @ 2012-08-20 23:12 beforus 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 可以使用//来注释一行。这种用法已经加入C99和ANSI C 2000中。 1 using namespace std; // Using the standard library namespace. 2 #include <iostream> // The iostream library is often used. 3 4 int main () // The program's main routine. 5 { 6 double a; // Declaration of va... 阅读全文
posted @ 2012-08-20 23:10 beforus 阅读(120) 评论(0) 推荐(0) 编辑