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

https://code.sololearn.com/cXozDzJ5EB93/?ref=app

2nd Mar 2019, 4:08 PM
Jo0000
Jo0000 - avatar
2 Réponses
+ 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; }
2nd Mar 2019, 5:14 PM
unChabon
unChabon - avatar
+ 1
Yes, thankyou. That was the problem
2nd Mar 2019, 6:09 PM
Jo0000
Jo0000 - avatar