Posted on 2008-10-08 15:34
Robert Su 阅读(1462)
评论(0) 编辑 收藏 所属分类:
C/C++
#include <iostream>
#include <vector>
using namespace std;
int main(){
int ia[] = {1,2,3,4,5,6,7,8,9};
vector<int> ivec(ia,ia+9);
vector<int> tvec(ia,ia+9);
for (vector<int>::iterator it = ivec.begin();it != ivec.end();++it){
for (vector<int>::iterator iv = tvec.begin();iv != tvec.end();++iv){
cout<<*it<<"*"<<*iv<<"="<<*it * *iv<<" ";
if(*iv == 9)
cout<<endl;
}
}
}