#39295: 請益程式碼輸出問題


ChongYi (李崇翊)

學校 : 國立臺中第一高級中學
編號 : 240635
來源 : [116.59.244.233]
最後登入時間 :
2024-04-26 23:23:09
d123. 11063 - B2-Sequence -- UVa11063 | From: [1.165.228.166] | 發表日期 : 2024-02-02 21:47

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int n, in, time=0, key;
  while(cin >> n){
    key=1;
    time++;
    vector<int>v;
    v[0]=0;
    for(int i=1;i<n+1;i++){
      cin >> in;
      v.push_back(in);
      if(v[i]<=v[i-1]){
        key=0;
        cout << "Case #" << time << ": It is not a B2-Sequence." << endl;
        break;
      }
    }
    if(key==1){
      cout << "Case #" << time << ": It is a B2-Sequence." << endl;
    }
  }
}
 
ZeroJudge Forum