I can no longer access the online compiler when I click the gear button. It says Firefox cannot establish a connection. It does it with all my other browsers as well. Please help, I need to compile and run my program, but I can only do it with this website.
#include <iostream>
int main()
{
int input = 1;
int sum = 0;
while(input)
{
std::cin >> input;
std::cout << "The inputted number was: " << input << '\n';
sum += input;
}
std::cout << "The sum of these numbers is " << sum << std::endl;
return 0;
}
The inputted number was: 1
The inputted number was: 2
The inputted number was: 3
The inputted number was: 4
The inputted number was: 5
The inputted number was: 6
The inputted number was: 7
The inputted number was: 8
The inputted number was: 9
The inputted number was: 0
The sum of these numbers is 45
Compiled with g++ main.cpp && ./a.out <<< "1 2 3 4 5 6 7 8 9 0" though you can use clang if you want.
@giblit, could you please go more in depth with how to type the input? I do not understand how you got the input data to show up, it did not work for me.
1) Open http://coliru.stacked-crooked.com/
2) Notice another text field at the bottom of the page, to the left of Compile, link and run button.
3) It has something like g++ main.cpp && ./a.out
4) Change it so it reads g++ main.cpp && ./a.out <<< "1 2 3 4 5 6 7 8 9 0" where bold part is what do you want to pass into program.