My program runs perfectly fine on my pc. But while submitting it on code chef, it shows a long list of compilation errors.
I am a first time submitter... please review my code and help! :)
By the way, I use Turbo C++.
#include <iostream>
using namespace std;
int main()
{
int t,x,n;
std::cin>>t;
while(t--)
{
std::cin >> n;
x=(n/2) + (n/3) + (n/4);
if (x>n)
std::cout <<x<<; // The error is here. Use std::cout <<x<< endl;
else
std::cout <<n<<; // And here as well.
}
return 0;
}
Edited by @anton_lunyov to fix the code display issue and also to indicate errors directly in code.