<分区>
我目前正在大学学习 C++ 入门类(class)。这是一个非常简单的家庭作业,我必须使用 3 种不同的方法来编程以输出“1 2 3 4”。以我目前的技能,如何为我刚刚编写的程序添加可视化界面?我的意思是,我想更改颜色、添加按钮或图片或其他任何内容。这可能吗?
//Jaehyuk Oh
//Professor Kan, Shaobai
// 2/9/2014
// HWK. 2.17
// (Printing) Write a program that prints the numbers 1 to 4 on the same line with each pair of adjacent numbers separated bt one space. Do this several ways:
// a) using one statement with one stream insertion operation.
// b) using one statement with four stream insertion operators.
// c) using four statements.
#include <iostream>
int main()
{
std::cout<<"1 2 3 4\n"; // ------> a)
std::cout<<"1 "<<"2 "<<"3 "<<"4\n"; // ------> b)
std::cout<<"1 "; // ----------> c)
std::cout<<"2 ";
std::cout<<"3 ";
std::cout<<"4"<<std::endl;
system("PAUSE");
return 0;
}