题解 AT3523 【OddString】

如题,输出奇数位上的字母即可AC

注意字符串下标是从0开始的!

Code

#include<bits/stdc++.h>
using namespace std;
char s[100010];
int main()
{    
    gets(s);
    for(int i=0;i<strlen(s);i+=2)//输出奇数位
    {
        printf("%c",s[i]);
    }
    printf("\n");//记得换行
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/WKAHPM/p/11628891.html