0
Why is ./a.out not letting me test my code with input values. In my terminal I wrote, g++ -std=c++11 perfect.cpp && ./a.out
2 Answers
+ 3
You have serveral "errors"...
As you aren't calling perfect() in main() when you run the code in "real" environment it simply does the only thing in your main():return 0;
Try moving cin >> x; from perfect() to main() and add cout <<
perfect(x);
int main() {
int x;
cin >> x;
cout << perfect(x);
return 0;
}
And continue from here... :)
int main(void){
bool perfect(unsigned int x);
return 0;
}
+ 1
Yes, thankyou. That was the problem