They do get input - via the software that’s loaded into them. At some point, someone or something put that software in the machine. The software not only defines the algorithm it runs, but also the initial data used to run it. Further, as the program progresses it can get furthermore data that was loaded along with the program.
There’s another input too: power. Turn on the power, and the machine runs its software.