#include <iostream> #include <iterator> int main() { int array[10] = {0,1,2,3,4,5,-6,-7,8,9}; int* pbeg = std::begin(array) , *pend = std::end(array); while(pbeg != pend && *pbeg >=0) { std::cout<<*pbeg<<std::endl; ++pbeg ; } }
时间: 2024-11-03 22:07:30