题解 AT3523 【OddString】

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

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

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
#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;
}