解题思路:
水题,开挂
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题6.8 (C语言代码)浏览:522 |
剪刀石头布 (C++代码)浏览:1703 |
敲七 (C++代码)浏览:1050 |
C语言程序设计教程(第三版)课后习题9.3 (C语言代码)浏览:574 |
发工资咯 (C语言代码)浏览:792 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:471 |
WU-玉龙学长买雪糕 (C++代码)浏览:1105 |
2006年春浙江省计算机等级考试二级C 编程题(1) (C语言描述——不利用数组,直接接收数据并判断等级。快来体验一下吧(*^__^*) 嘻嘻……)浏览:563 |
WU-蓝桥杯历届试题-核桃的数量 (C++代码)浏览:1021 |
回文数字 (C语言代码)浏览:512 |