技術(shù)交流QQ群:1027579432缎脾,歡迎你的加入!
#include <iostream>
#include <vector>
using namespace std;
int main(){
int x = 0;
vector<vector<int>> vec;
vector<int> v;
while(cin >> x){
v.push_back(x);
if(cin.get() == '\n'){
vec.push_back(v);
v.clear();
}
if(cin.peek() == '\n'){
vec.push_back(v);
break;
}
}
cout << "row:" << vec.size() << endl;
cout << "col:" << v.size() << endl;
cout << "驗證輸出\n";
for(int i = 0; i < vec.size(); i++){
for(int j = 0; j < v.size(); j++){
cout << vec[i][j] << " ";
}
}
return 0;
}
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者