提交不能同過
#include
using namespace std; int main(void) { ? ?//定義常量count ? ?const int count = 3; ? ?const int *p = &count; ? ?//打印count次字符串Hello C++ for(int i = 0;i < *p; i++){ ? ? cout << "Hello imooc" << endl; ? } return 0; } 不對(duì)嗎,為什么不能通過啊#include
using namespace std; int main(void) { ? ?//定義常量count ? ?const int count = 3; ? ?const int *p = &count; ? ?//打印count次字符串Hello C++ for(int i = 0;i < *p; i++){ ? ? cout << "Hello imooc" << endl; ? } return 0; } 不對(duì)嗎,為什么不能通過啊2015-05-30
舉報(bào)
2016-03-12
好復(fù)雜的問題,以下代碼在我的環(huán)境中直接就通過了,
#include <iostream>
using namespace std;
int main(void)
{
? ? const int count = 3;
? ? const int *const p = &count;
for(int i = 0; i < *p; i++)
{
cout << "Hello imooc" << endl;
}?
return 0;
}
但是在網(wǎng)頁上提交時(shí),還得include一下才行。。。
#include <stdlib.h>
2015-11-28
#include<iostream>
using namespace std; int main(void) { ? ?//定義常量count ? ?const int count = 3; ? ?const int *p = &count; ? ?//打印count次字符串Hello C++ for(int i = 0;i < *p; i++){ ? ? cout << "Hello imooc" << endl; ? } return 0; }?
cout是在iostream中定義的
2015-06-06
#include后面沒有頭文件
2015-06-01
你在試試,你代碼沒有問題