解题思路:
水题,开挂
注意事项:
参考代码:
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <string> #include <vector> #include <set> #include <map> using namespace std; vector<int> numSet; void getNonZeroArray(int n) { int temp = 0; for (int i = 0; i < n; i++) { cin >> temp; if (temp != 0) numSet.push_back(temp); } } int main(int argc, char** argv) { int n = 0; cin >> n; getNonZeroArray(n); for (vector<int>::iterator it = numSet.begin(); it < numSet.end(); it++) { cout << *it << " "; } cout << endl; cout << numSet.size() << endl; return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:619 |
Tom数 (C++代码)浏览:828 |
C语言程序设计教程(第三版)课后习题8.9 (Java代码)浏览:1334 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:528 |
WU-格式化数据输出 (C++代码)浏览:1212 |
校门外的树 (C语言代码)浏览:700 |
愚蠢的摄影师 (C++代码)浏览:938 |
简单的a+b (C语言代码)浏览:546 |
printf基础练习2 (C语言代码)浏览:503 |
C语言程序设计教程(第三版)课后习题12.1 (C语言代码)浏览:646 |