首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

警告无法排除~()

2012-02-06 
警告无法排除~请指教~(在线等)#include iostreamusingnamespacestdvoiddelay(inta2)intmain()//就是

警告无法排除~请指教~(在线等)
#include <iostream>
using   namespace   std;
      void   delay(int   a=2);
      int   main()           //就是在这里~不能为int~只能为void~
      {
      cout < < "delay   2   sec... ";
      delay();
      cout < < "end.\n ";
      cout < < "delay   5   sec... ";
      delay(5);
      cout < < "ended.\n ";
      }
                    void   delay(int   a)
    {
    int   sum=0;
    for(int   i=1;i <=a;++i)
                            for(int   j=1;j <3500;++j)
                            for(int   k=1;k <100000;++k)   sum++;
    }
    是个小问题~但是心里有点疙瘩~有那位前辈知道的请指教下~
    谢谢~

[解决办法]
不能为“int”?
最后加一句“return 0;”试试看?
[解决办法]
int main
{

return 0;
}
[解决办法]
为int就要有返回值

:)

热点排行