#include #include #include using namespace std; //FILE* fin=freopen("date.in","r",stdin); //FILE* fout=freopen("date.out","w",stdout); int n,lg; char nr[20],c1,c2; int main() { int i; //scanf("\n"); //scanf("%s %c %c",nr,&c1,&c2); while (1==1) { scanf("%s %c %c",nr,&c1,&c2); if (nr[0]=='0' && c1=='0' && c2=='0') exit(0); lg=strlen(nr); for (i=0; i