Tag: problem: (A) Hongcow Learns the Cyclic Shift Solve in C/C++

Codeforces Round #385 (Div. 2), problem: (A) Hongcow Learns the Cyclic Shift Solution in C/C++

#include<stdio.h> #include<string.h> void cycle(char s,int len) { char temp=s; int i; for(i=len-1;i>0;i--) { s=s; } s=temp; } int main(){ char s,orig; int len,count=0; scanf("%s",s); len=strlen(s); strcpy(orig,s); do { cycle(s,len); count++; } while(strcmp(orig,s)); printf("%dn",count); return 0; }

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!