amdb

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
#include <iostream>
using namespace std;
 
int main()
{
     int a[3][4]={1,2,3,4,5,6,7,8,9,10,11,12};
 
 /*  for(int (&i)[4]:a)        
         for(int (&j):i)
             cout<<j<<endl;
 */
 
 /*  for(int i=0;i<3;i++)
         for(int j=0;j<4;j++)
             cout<<a[i][j]<<endl;
 */
 
 /*  for(int (*p)[4]=a;p<a+3;p++)
         for(int *q=*p;q<*p+4;q++)
             cout<<*q<<endl;
 */
 
 /*  for(auto &i:a)
         for(auto &j:i)
             cout<<j<<endl;
 */
 
     for(auto p=a;p<a+3;p++)
         for(auto q=*p;q<*p+4;q++)
             cout<<*q<<endl;
     return 0;
 
 }

 

posted on 2014-11-28 22:27  amdb  阅读(266)  评论(0编辑  收藏  举报