#include
#include
using namespace std;
int main()
{
vector
printf("now you can input your number('q' to exit):\r\n");
while (1)
{
char str[1024] = {0};
printf("number: \r\n");
scanf("%s", str);
if (str[0] == 'q' && str[1] == 0)
break;
int nNum = atoi(str);
vecInt.push_back(nNum);
printf("okay, go on(press 'q' to exit)\r\n");
}
printf("the following is that you inputed numbers: \r\n");
size_t pos = 0;
while (pos
printf("%d ", vecInt[pos ++]);
}
printf("\r\n-----the end, press any key to exit--------\r\n");
getchar();
getchar();
return 0;
}
该代码在VC6中调试过,楼主要厚道啊,要给分啊,才10分啊,好廉价啊