题解 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;
}

posted @ 2019-10-06 22:56  zyx_00  阅读(104)  评论(0编辑  收藏  举报