Reverse Repeated Printing by yutaka

#include<iostream>\x0d
#include<string>\x0d
using namespace std;\x0d
int main(){int i,j;string s;while(getline(cin,s)){for(i=0;i<(j=s.size())&&s[i]==s[0];++i);cout<<s[0]<<" "<<s[j-1]<<" "<<i<<endl;}}

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

download

return to the top page