Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
79280 张誉腾 【一维数组】约瑟夫问题 C++ Compile Error 0 MS 0 KB 347 2024-06-30 17:13:11

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n,m; queue<int> live; for(int i=1;i<=n;i++){ live.push(i); } int bs=0; while(live.sivz()!=1){ int ren=live.front(); live.pop(); int a=0; a++; if(a==m){ a=0; }else{ live.push(ren) } } cout<<live.front(); live.pop(); }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:10: warning: right operand of comma operator has no effect [-Wunused-value]
  cin>>n,m;
          ^
Main.cc:13:13: error: 'class std::queue' has no member named 'sivz'
  while(live.sivz()!=1){
             ^
Main.cc:22:3: error: expected ';' before '}' token
   }
   ^
Main.cc:12:6: warning: unused variable 'bs' [-Wunused-variable]
  int bs=0;
      ^