如题,输出奇数位上的字母即可AC
注意字符串下标是从0开始的!
#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(" ");//记得换行 return 0; }