diff --git a/QUSTOJ/1856.cpp b/QUSTOJ/1856.cpp new file mode 100644 index 0000000..bab9803 --- /dev/null +++ b/QUSTOJ/1856.cpp @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include +using namespace std; +vector a; +int main() +{ + int t; + scanf("%d",&t); + int tmp; + for(int i=0;i(int)a.size()+1) + { + printf("对不起,插入位置错误!\n"); + return 0; + } + a.insert(a.begin()+id-1,val); + for(int i=0;i<(int)a.size()-1;i++) + { + printf("%d ",a.at(i)); + } + printf("%d\n",a.at(a.size()-1)); + return 0; +} +/* +5 +2 4 6 8 10 +7 2 + +8 +1 2 3 4 5 6 7 8 +7 9 + +*/