笔试题各种输入格式总结
输入格式一
输入:
2,
3,1, 1,
4
输出:
2
3
1
1
4
#include <iostream>
#include <vector>
using namespace std;
int main() {
char mk[100001];
int i = 0;
vector<int> t;
while (cin >> mk[i])
{
char c = mk[i];
int a =c-'0';
if (a ==-132 )
continue;
t.push_back(a);
i++;
if (cin.get() == '\n')
{
break;
}
}
for (vector<int>::iterator it = t.begin(); it != t.end(); it++)
{
cout << *it << endl;
}
system("pause");
return 0;
}