Skip to main content

Command Palette

Search for a command to run...

C++(avoid using std multiple times)

Published
1 min readView as Markdown
#include <iostream>
//import string then can declare string
#include <string>

// using namespace std avoid std::cout;
using namespace std;


int main() {

    // TODO: change the code so that it no longer uses "std::"
   // std::string, std::cout, std::endl    

    string fruit = "apple";
    string vegetable = "broccoli";

    cout << "My favorite fruit is " << fruit <<
      " and my favorite vegetable is " << vegetable << "\n";

    return 0;
}