Digital root Fixed by Tyler F

#include <iostream>\x0d
int main(){long input;for(;;){std::cin>>input;if(std::cin.fail())break;std::cout<<"digital_root("<<input<<")="<<(input%9==0?9:input%9)<<std::endl;}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page