小编Pas*_*kov的帖子

代码编译,但没有控制台输出

我的C++代码编译并运行,但没有输出打印到控制台.我认为它与字符串变量有关,但我不确定.我是一个总菜鸟,任何帮助将不胜感激.我正在使用GNU GCC编译器的代码块.

#include <iostream>
#include <string>
using namespace std;

int main()
{
    string botlong, botshort, secondline;
    botlong = "bottles of beer on the wall,";
    botshort = "bottles of beer";
    secondline = "Take one down and pass it around,";
    for(int bottles = 99; bottles<=0; bottles--)
    {
        cout<<bottles <<botlong <<bottles <<botshort;
        for(int lostB = 98; lostB<=0; lostB--)
        {
            cout<<secondline<<lostB<<botlong;
        }
    }
    return 0;
};
Run Code Online (Sandbox Code Playgroud)

c++ gcc gnu codeblocks

1
推荐指数
1
解决办法
93
查看次数

标签 统计

c++ ×1

codeblocks ×1

gcc ×1

gnu ×1