【发布时间】:2016-01-11 17:21:50
【问题描述】:
我尝试在谷歌搜索结果上阅读几个不同的帮助论坛结果,但似乎没有一个适用于我的情况。我的 Netbeans 8.0.2 没有显示任何输出。我的程序具有 cout 的功能,而其他程序则具有 cout 的主要功能。什么都没有出现。 Kicker 是没有返回错误。不知道你们是否可以帮助我,但我仍然充满希望。
操作系统:Ubuntu 14.04 LTS
Netbean 版本:8.0.2
这是一个示例代码:
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
class calender
{
private:
int month;
int day;
int year;
public:
void getdate(int m, int d, int y);
void showdate();
};
void calender::getdate(int m, int d, int y){
m=month;
d=day;
y=year;
}
void calender::showdate(){
cout<<"The date is:"<<setfill('0')<<setw(2)<<month<<"/"<<setw(2)<<day
<<"/"<<setw(2)<<year<<endl;
}
int main() {
int month, day, year;
char contin;
while (contin=='y'){
calender c1;
cout<<"What is the month: ";
cin>>month;
cout<<"What is the day: ";
cin>>day;
cout<<"What is the year: ";
cin>>year;
c1.getdate(month,day,year);
c1.showdate();
cout<<"Do you want to continue(y/n): ";
cin>>contin;
}
return 0;
}
【问题讨论】:
标签: c++ linux netbeans terminal output