C、分栏

分栏

https://ac.nowcoder.com/acm/contest/5733/C

签到题

乌拉5个牛币也是币~,欸嘿嘿。,
题目看起来是竖着输出,但是很显然,步长改为2即可输出原字符串/。


#pragma GCC optimize("O2,O3,Ofast,inline,unroll-all-loops,-ffast-math")
#pragma GCC optimize("O2,O3,Ofast,inline,unroll-all-loops,-ffast-math")
#include <bits/stdc++.h>
using namespace std;
#define js ios::sync_with_stdio(false);cin.tie(0); cout.tie(0)
typedef long long ll; typedef unsigned long long ull; typedef long double ld;
const ll MOD = 1e9 + 7;
inline ll read() { ll s = 0, w = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar()) if (ch == '-') w = -1; for (; isdigit(ch); ch = getchar())    s = (s << 1) + (s << 3) + (ch ^ 48); return s * w; }
inline void write(ll x) { if (!x) { putchar('0'); return; } char F[40]; ll tmp = x > 0 ? x : -x; if (x < 0)putchar('-');    int cnt = 0;    while (tmp > 0) { F[cnt++] = tmp % 10 + '0';        tmp /= 10; }    while (cnt > 0)putchar(F[--cnt]); }
inline ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll qpow(ll a, ll b) { ll ans = 1;    while (b) { if (b & 1)    ans *= a;        b >>= 1;        a *= a; }    return ans; }    ll qpow(ll a, ll b, ll mod) { ll ans = 1; while (b) { if (b & 1)(ans *= a) %= mod; b >>= 1; (a *= a) %= mod; }return ans % mod; }
inline int lowbit(int x) { return x & (-x); }

const int N = 1e5 + 7;
string s;
int main() {
    js;
    cin >> s;
    int len = s.size();
    for (int i = 0; i < len; i += 2)
        cout << s[i];
    for (int i = 1; i < len; i += 2)
        cout << s[i];
    return 0;
}
全部评论

相关推荐

03-02 17:23
门头沟学院 Java
程序员小白条:换项目,然后技术栈加点408丰富,然后有没有水赛奖项填充下,另外注意主修课程没必要写,除非全是99,100...其他分数毫无毕业,你都985了
点赞 评论 收藏
分享
03-12 15:35
嘉应学院 Python
快说谢谢牛牛精灵:说不定就是下一个寒武纪!
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务