标签:style cout space bsp span pac ack while log
#include <iostream> #include <vector> using namespace std; int main() { int a; char b; vector<int> c1; vector<int> c2; while(cin>>a>>b) { //cout<<a<<‘ ‘<<b<<‘ ‘; if(b==‘r‘) c1.push_back(a); if(b==‘b‘) c2.push_back(a); } for(int i:c1) cout<<i; cout<<endl; for(int i:c2) cout<<i; }
输入示例:1r 2b 3r 4b
输出示例:
13
24
标签:style cout space bsp span pac ack while log
原文地址:http://www.cnblogs.com/home123/p/7465213.html