Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
92580 只因你太美(Ikun 真爱粉) 22插入数据 C++ Wrong Answer 0 MS 272 KB 568 2024-10-05 17:25:11

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() #include<string> using namespace std; int main(){ int n; bool b=1; cin>>n; int a[n+1]; for(int i=0;i<n-1;i++){ cin>>a[i]; } int m; cin>>m; for(int i=0;i<n-1;i++){ if(a[i]>=m&&a[i+1]<=m&&b){ cout<<m<<" ";i--;b=0;} else{ cout<<a[i]<<" ";} } return 0; }


Run Info:

------Input------
25 566 561 556 551 546 541 536 531 526 521 516 511 506 501 496 491 486 481 476 471 466 461 456 456 210
------Answer-----
566 561 556 551 546 541 536 531 526 521 516 511 506 501 496 491 486 481 476 471 466 461 456 456 210
------Your output-----
566 561 556 551 546 541 536 531 526 521 516 511 506 501 496 491 486 481 476 471 466 461 456 456