#38210: C++


11131039@stu.tshs.tp.edu.tw (二孝25林孟希)

學校 : 不指定學校
編號 : 201083
來源 : [125.228.248.38]
最後登入時間 :
2024-04-17 14:50:03
f046. 公車上的跑馬燈 -- 板橋高中Python教學題 | From: [36.225.120.92] | 發表日期 : 2023-11-03 21:33

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int w; cin>>w;
    cin.ignore();
    string s; getline(cin,s);
    int t; cin>>t;
    for(int i=0;i<w;i++) s+=" ";
    for(int i=0;i<w;i++) s.insert(0," ");
    for(int i=t;i<t+w;i++) cout<<s[i];
}

 

 

 
ZeroJudge Forum