4 solutions

  • 1
    @ 2026-1-17 14:56:56
    
      #include<bits/stdc++.h>
      using namespace std;
      const int N=100001;
      char a[N];
      char b[N];
      int main()
      {
      	cin>>a;
      	int n=strlen(a);
      	for(int i=0;i<=n;i++)
      	{
      		b[i]=a[i]+a[i+1]
      		if(i==n-1)
      		{
      			b[i]=a[0]+a[i];
      		}
      	}
      	cout<<b;
      	return 0;
      }
    

    Information

    ID
    917
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    74
    Accepted
    44
    Uploaded By