#31175: 科科


b09901113@g.ntu.edu.tw (戴子珅)

學校 : 不指定學校
編號 : 197132
來源 : [118.165.171.15]
最後登入時間 :
2022-07-12 16:48:53
g489. 社團點點名 | From: [118.165.182.115] | 發表日期 : 2022-07-17 00:31

#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
    vector<string> Buffer;
    int All,Participate;
    cin>>All>>Participate;
    for(int I=0;I<(All+Participate);I++){
        string Tmp;
        cin>>Tmp;
        Buffer.push_back(Tmp);
    }
    cout<<(All-Participate)<<endl;
}
要不是他還要輸入,我那個迴圈根本可以省掉...
 
#31552: Re: 科科


wubaie (小億)

學校 : 不指定學校
編號 : 123253
來源 : [220.133.154.226]
最後登入時間 :
2024-05-07 20:47:50
g489. 社團點點名 | From: [220.133.154.226] | 發表日期 : 2022-08-07 09:29

#include
#include
#include
using namespace std;
int main(){
    vector Buffer;
    int All,Participate;
    cin>>All>>Participate;
    for(int I=0;I<(All+Participate);I++){
        string Tmp;
        cin>>Tmp;
        Buffer.push_back(Tmp);
    }
    cout<<(All-Participate)<
}
要不是他還要輸入,我那個迴圈根本可以省掉...

push_back可以不用做

 
ZeroJudge Forum