+ 3
Having a bit of difficulty having this code to run on SoloLearn.
I know it does run on Visual Studio, any C++ help would be much appreciated thank you. https://code.sololearn.com/cUuN0uVcopj2/?ref=app
4 Réponses
+ 6
//#include "stdafx.h"
//this is a precompiled header specifically for VS. It is not in the code playground and is only used to make the program compile faster.
#include <iostream>
#include <Windows.h>
DWORD waitingTime1 = 7000;
DWORD waitingTime2 = 5000;
bool adventureTimeTshirt = true;
bool batmanTshirt = true;
int main()//This should be int, I’m surprised it even ran in VS.
{
bool isNerdyDay = adventureTimeTshirt && batmanTshirt;
if (isNerdyDay)
{
std::cout << "\n Not sure if I'm a nerd\n\n"
<< "\t 😱\n\n"
<< "or just like cartoons and comics\n\n";
//Sleep(waitingTime1);
//the code here gets compiled in a special way. It and any input gets sent to SoloLearn servers to be compiled and run, then the output is sent back here. If the run time is greater than they allow, it just says, “Time Limit Exceeded” and stops running.
std::cout << "\n\t Bazinga!\n\n\n";
//Sleep(waitingTime2);
//Same problem.
}
}
I left comments in all of the parts that caused problems.
+ 4
I could be mistaken but maybe it has to do with the include
+ 2
Thank you Jacob and Martin